[fpc-pascal] alloca
Steve Litt
slitt at troubleshooters.com
Sun May 15 00:50:42 CEST 2022
Hairy Pixels via fpc-pascal said on Fri, 13 May 2022 22:43:15 +0700
>Is there an “alloca" like function in the RTL which allocates memory
>from the stack? For example
>https://man7.org/linux/man-pages/man3/alloca.3.html
Why not just allocate from the heap? Everything I've seen tells me that
if you want a variable with memory from the stack, you just declare it
and it's valid throughout the procedure or function in which it's
declared, and gets reused when you go out of scope (no need to free).
SteveT
Steve Litt
March 2022 featured book: Making Mental Models: Advanced Edition
http://www.troubleshooters.com/mmm
More information about the fpc-pascal
mailing list