alloca is slow and dangerous

welkam wwwelkam at gmail.com
Fri Jan 1 14:48:11 UTC 2021


Over the years I saw several people asking why D doesn't have 
alloca. I just want to share a video where it states that alloca 
is slower than static array so we have one more arguments against 
it.
https://youtu.be/FY9SbqTO5GQ?t=468

In summary alloca is:
1. Hard to implement
2. security problem
3. slower than static array on the stack


More information about the Digitalmars-d mailing list