diff options
author | dec05eba <dec05eba@protonmail.com> | 2019-09-14 00:52:24 +0200 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2020-07-25 14:36:46 +0200 |
commit | 7d663615b2a44715e7447a40cae467d7d4e38b9c (patch) | |
tree | 612e81f55ca73c3da868bd2ab6cd96ae6ac30a15 /src/std/arena_allocator.c | |
parent | 7103d3a1df6c7fee6e8efbe3588204d1e869004e (diff) |
Start on opengl test, fix stack alignment before call (sys-v)
Diffstat (limited to 'src/std/arena_allocator.c')
-rw-r--r-- | src/std/arena_allocator.c | 5 |
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*)); } |