aboutsummaryrefslogtreecommitdiff
path: root/src/std/arena_allocator.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/std/arena_allocator.c')
-rw-r--r--src/std/arena_allocator.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/std/arena_allocator.c b/src/std/arena_allocator.c
index 11fb40d..8b0083d 100644
--- a/src/std/arena_allocator.c
+++ b/src/std/arena_allocator.c
@@ -74,7 +74,8 @@ static usize align_ptr_ceil_offset(void *ptr, uintptr_t alignment) {
return (uintptr_t)align_ptr_ceil(ptr, alignment) - (uintptr_t)ptr;
}
-#define ALLOC_ALIGNMENT 8
+/* 16-byte alignment allows SIMD instructions to be operated on the data */
+#define ALLOC_ALIGNMENT 16
int arena_allocator_alloc(ArenaAllocator *self, usize size, void **mem) {
ArenaAllocatorNode *current;
@@ -103,6 +104,6 @@ int arena_allocator_alloc(ArenaAllocator *self, usize size, void **mem) {
int arena_allocator_add_mem(ArenaAllocator *self, usize *result_index) {
void *null_data;
null_data = NULL;
- *result_index = buffer_get_size(&self->mems, void*);
+ *result_index = self->mems.size;
return buffer_append(&self->mems, &null_data, sizeof(void*));
}