AVR Libc Home Page AVRs AVR Libc Development Pages
Main Page User Manual Library Reference FAQ Alphabetical Index Example Projects

<alloca.h>: Allocate space in the stack


void * alloca (size_t __size)

Detailed Description

Function Documentation

void* alloca ( size_t  __size)

Allocate __size bytes of space in the stack frame of the caller.

This temporary space is automatically freed when the function that called alloca() returns to its caller. Avr-libc defines the alloca() as a macro, which is translated into the inlined __builtin_alloca() function. The fact that the code is inlined, means that it is impossible to take the address of this function, or to change its behaviour by linking with a different library.

alloca() returns a pointer to the beginning of the allocated space. If the allocation causes stack overflow, program behaviour is undefined.
Avoid use alloca() inside the list of arguments of a function call.

Automatically generated by Doxygen 1.8.7 on Tue Aug 12 2014.