---
name: "alloca"
section: "3avr"
platform: "linux"
package: "avr-libc"
version: "1:2.2.1-1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/alloca/3avr"
---

# alloca(3avr)

\<alloca.h\>: Allocate space in the stack

## NAME

alloca - \<alloca.h\>: Allocate space in the stack

## SYNOPSIS

### Functions

void \* **alloca** (size\_t \_\_size)\

## Detailed Description

## Function Documentation

### void \* alloca (size\_t \_\_size)` [extern]`

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.

**Returns**

alloca() returns a pointer to the beginning of the allocated space. If the allocation causes stack overflow, program behaviour is undefined.

**Warning**

Avoid use alloca() inside the list of arguments of a function call.

## Author

Generated automatically by Doxygen for AVR-LibC from the source code.
