From 7d663615b2a44715e7447a40cae467d7d4e38b9c Mon Sep 17 00:00:00 2001 From: dec05eba Date: Sat, 14 Sep 2019 00:52:24 +0200 Subject: Start on opengl test, fix stack alignment before call (sys-v) --- src/std/arena_allocator.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/std/arena_allocator.c') 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*)); } -- cgit v1.2.3