Asterisk - The Open Source Telephony Project GIT-master-d856a3e
|
Temporary memory allocation on stack. More...
Go to the source code of this file.
Macros | |
#define | ALIGN(stack, size) ((stack) += ((size) - (long)(stack)) & ((size) - 1)) |
#define | ALLOC(var, size, type) var = PUSH(stack, size, type) |
#define | PUSH(stack, size, type) (ALIGN((stack),sizeof(type)),(stack)+=((size)*sizeof(type)),(type*)((stack)-((size)*sizeof(type)))) |
#define | VARDECL(var) var |
Temporary memory allocation on stack.
Definition in file stack_alloc.h.
#define ALIGN | ( | stack, | |
size | |||
) | ((stack) += ((size) - (long)(stack)) & ((size) - 1)) |
Aligns the stack to a 'size' boundary
stack | Stack |
size | New size boundary |
Definition at line 97 of file stack_alloc.h.
Allocate 'size' elements of 'type' on stack
var | Name of variable to allocate |
size | Number of elements |
type | Type of element |
Definition at line 111 of file stack_alloc.h.
#define PUSH | ( | stack, | |
size, | |||
type | |||
) | (ALIGN((stack),sizeof(type)),(stack)+=((size)*sizeof(type)),(type*)((stack)-((size)*sizeof(type)))) |
Allocates 'size' elements of type 'type' on the stack
stack | Stack |
size | Number of elements |
type | Type of element |
Definition at line 99 of file stack_alloc.h.
Declare variable on stack
var | Variable to declare |
Definition at line 110 of file stack_alloc.h.