fix: major bug in allocator

This commit is contained in:
2026-01-12 20:45:02 +02:00
parent 21a5e3e068
commit 4bf1ccd9e7
2 changed files with 3 additions and 2 deletions

View File

@@ -81,8 +81,9 @@ niarena_alloc(NIArena **self, size_t size)
niarena_error("niarena_alloc: out of memory inside of the arena");
return NULL;
}
void *ret = (void *)(((char *)arena->buffer) + arena->offset);
arena->offset += size;
return (void *)((char *)arena->buffer + arena->offset);
return ret;
}
void