Fix nasty bug where the node copies did not get a proper id.

This commit is contained in:
Christoffer Lerno
2021-05-31 21:06:31 +02:00
committed by Christoffer Lerno
parent cf58da4a3c
commit 95f39f42eb
16 changed files with 48 additions and 219 deletions

View File

@@ -16,4 +16,5 @@ static inline type *name##_calloc(void) { \
memset(ptr, 0, sizeof(type)); \
return ptr; } \
static inline type *name##ptr(type ## Id id) { return ((type *)name##_arena.ptr) + id; } \
static inline type##Id name##id(type *ptr) { return (unsigned) { ptr - ((type *)name##_arena.ptr) }; }
static inline type##Id name##id(type *ptr) { return (unsigned) { ptr - ((type *)name##_arena.ptr) }; } \
static inline type *name##_copy(type *ptr) { type *x = name##_alloc(); memcpy(x, ptr, sizeof(type)); return x; }