| 36 | } |
| 37 | |
| 38 | static CBMScopeChunk* alloc_chunk(CBMScope* scope) { |
| 39 | if (!scope->arena) { |
| 40 | return NULL; |
| 41 | } |
| 42 | CBMScopeChunk* c = (CBMScopeChunk*)cbm_arena_alloc(scope->arena, sizeof(CBMScopeChunk)); |
| 43 | if (!c) { |
| 44 | return NULL; |
| 45 | } |
| 46 | memset(c, 0, sizeof(CBMScopeChunk)); |
| 47 | c->next = scope->chunks; |
| 48 | scope->chunks = c; |
| 49 | return c; |
| 50 | } |
| 51 | |
| 52 | static uint32_t scope_name_hash(const char *name) { |
| 53 | uint32_t h = 2166136261u; /* FNV-1a */ |
no test coverage detected