| 5 | #include <stdio.h> |
| 6 | |
| 7 | void cbm_arena_init(CBMArena *a) { |
| 8 | memset(a, 0, sizeof(*a)); |
| 9 | a->block_size = CBM_ARENA_DEFAULT_BLOCK_SIZE; |
| 10 | a->blocks[0] = (char *)malloc(a->block_size); |
| 11 | if (a->blocks[0]) { |
| 12 | a->nblocks = SKIP_ONE; |
| 13 | } |
| 14 | } |
| 15 | |
| 16 | static int arena_grow(CBMArena *a, size_t min_size) { |
| 17 | if (a->nblocks >= CBM_ARENA_MAX_BLOCKS) { |
no outgoing calls