12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455 |
- #ifndef ZEND_STATIC_ALLOCATOR_H
- #define ZEND_STATIC_ALLOCATOR_H
- #define ALLOCATOR_BLOCK_SIZE 400000
- typedef unsigned int zend_uint;
- #define emalloc(s) malloc(s)
- #define efree(p) free(p)
- typedef struct _Block {
- char *bp;
- char *pos;
- char *end;
- } Block;
- typedef struct _StaticAllocator {
- Block *Blocks;
- zend_uint num_blocks;
- zend_uint current_block;
- } StaticAllocator;
- void static_allocator_init(StaticAllocator *sa);
- char *static_allocator_allocate(StaticAllocator *sa, zend_uint size);
- void static_allocator_destroy(StaticAllocator *sa);
- #endif
|