|
webkit
2cdf99a9e3038c7e01b3c37e8ad903ecbe5eecf1
https://github.com/WebKit/webkit
|
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 | PUSH(stack, size, type) (ALIGN((stack),sizeof(type)/sizeof(char)),(stack)+=(size)*(sizeof(type)/sizeof(char)),(type*)((stack)-(size)*(sizeof(type)/sizeof(char)))) |
| #define | RESTORE_STACK (global_stack = _saved_stack) |
| #define | ALLOC_STACK char *_saved_stack; (global_stack = (global_stack==0) ? (scratch_ptr=opus_alloc_scratch(GLOBAL_STACK_SIZE)) : global_stack); _saved_stack = global_stack; |
| #define | VARDECL(type, var) type *var |
| #define | ALLOC(var, size, type) var = PUSH(global_stack, size, type) |
| #define | SAVE_STACK char *_saved_stack = global_stack; |
| #define | ALLOC_NONE 0 |
| #define | OPUS_CHECK_ARRAY(ptr, len) _opus_false() |
| #define | OPUS_CHECK_VALUE(value) _opus_false() |
| #define | OPUS_PRINT_INT(value) do{}while(0) |
| #define | OPUS_FPRINTF (void) |
Variables | |
| char * | global_stack |
| char * | scratch_ptr |
Temporary memory allocation on stack.
Aligns the stack to a 'size' boundary
| stack | Stack |
| size | New size boundary |
Allocate 'size' elements of 'type' on stack
| var | Name of variable to allocate |
| size | Number of elements |
| type | Type of element |
| #define ALLOC_NONE 0 |
| #define ALLOC_STACK char *_saved_stack; (global_stack = (global_stack==0) ? (scratch_ptr=opus_alloc_scratch(GLOBAL_STACK_SIZE)) : global_stack); _saved_stack = global_stack; |
| #define OPUS_CHECK_ARRAY | ( | ptr, | |
| len | |||
| ) | _opus_false() |
| #define OPUS_CHECK_VALUE | ( | value | ) | _opus_false() |
| #define OPUS_FPRINTF (void) |
| #define PUSH | ( | stack, | |
| size, | |||
| type | |||
| ) | (ALIGN((stack),sizeof(type)/sizeof(char)),(stack)+=(size)*(sizeof(type)/sizeof(char)),(type*)((stack)-(size)*(sizeof(type)/sizeof(char)))) |
Allocates 'size' elements of type 'type' on the stack
| stack | Stack |
| size | Number of elements |
| type | Type of element |
| #define RESTORE_STACK (global_stack = _saved_stack) |
| #define SAVE_STACK char *_saved_stack = global_stack; |
| char* global_stack |
| char* scratch_ptr |
1.8.13