Temporary memory allocation on stack.
More...
Go to the source code of this file.
|
#define | ALIGN(stack, size) ((stack) += ((size) - (long)(stack)) & ((size) - 1)) |
|
#define | PUSH(stack, size, type) (ALIGN((stack),sizeof(type)),(stack)+=((size)*sizeof(type)),(type*)((stack)-((size)*sizeof(type)))) |
|
#define | VARDECL(var) var |
|
#define | ALLOC(var, size, type) var = PUSH(stack, size, type) |
|
Temporary memory allocation on stack.
#define ALIGN |
( |
|
stack, |
|
|
|
size |
|
) |
| ((stack) += ((size) - (long)(stack)) & ((size) - 1)) |
Aligns the stack to a 'size' boundary
- Parameters
-
stack | Stack |
size | New size boundary |
#define ALLOC |
( |
|
var, |
|
|
|
size, |
|
|
|
type |
|
) |
| var = PUSH(stack, size, type) |
Allocate 'size' elements of 'type' on stack
- Parameters
-
var | Name of variable to allocate |
size | Number of elements |
type | Type of element |
#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
- Parameters
-
stack | Stack |
size | Number of elements |
type | Type of element |
#define VARDECL |
( |
|
var | ) |
var |
Declare variable on stack
- Parameters
-