[fpc-pascal] alloca

Jonas Maebe jonas at freepascal.org
Sat May 14 08:01:42 CEST 2022


On 14/05/2022 07:45, Jonas Maebe via fpc-pascal wrote:
> On 14/05/2022 03:34, Hairy Pixels via fpc-pascal wrote:
>>> On May 13, 2022, at 11:08 PM, Michael Van Canneyt via 
>>> fpc-pascal<fpc-pascal at lists.freepascal.org>  wrote:
>>>
>>>> Is there an “alloca" like function in the RTL which allocates memory 
>>>> from the stack? For 
>>>> examplehttps://man7.org/linux/man-pages/man3/alloca.3.html
>>> No such function exists in FPC.
>> Is alloca something which is part of the OS or can this be implemented 
>> by programmers or used from other libraries?
> 
> It compiler support for the allocation to actually happen on the stack. 
> When it's actually implemented in a library (rather than redirect to a 
> compiler intrinsic via a C macro), it will generally just allocate on 
> the heap instead.

It *requires* compiler support for...


Jonas


More information about the fpc-pascal mailing list