fix: major bug in allocator
This commit is contained in:
2
makefile
2
makefile
@@ -1,5 +1,5 @@
|
|||||||
RELEASE_flags=-DNDEBUG -O2 -g0
|
RELEASE_flags=-DNDEBUG -O2 -g0
|
||||||
DEBUG_flags=-std=c23 -DDEBUG -Wall -Wno-unknown-pragmas -Wpedantic -Wshadow -Wextra -Werror=implicit-int -Werror=incompatible-pointer-types -Werror=int-conversion -Wvla -g -Og
|
DEBUG_flags=-std=c23 -DDEBUG -Wall -Wno-unknown-pragmas -Wpedantic -Wshadow -Wextra -Werror=implicit-int -Werror=incompatible-pointer-types -Werror=int-conversion -Wvla -g -O0
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -fr bin
|
rm -fr bin
|
||||||
|
|||||||
@@ -81,8 +81,9 @@ niarena_alloc(NIArena **self, size_t size)
|
|||||||
niarena_error("niarena_alloc: out of memory inside of the arena");
|
niarena_error("niarena_alloc: out of memory inside of the arena");
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
void *ret = (void *)(((char *)arena->buffer) + arena->offset);
|
||||||
arena->offset += size;
|
arena->offset += size;
|
||||||
return (void *)((char *)arena->buffer + arena->offset);
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|||||||
Reference in New Issue
Block a user