diff options
author | dec05eba <dec05eba@protonmail.com> | 2019-02-27 23:04:36 +0100 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2020-07-25 14:36:46 +0200 |
commit | 0ed62b9337c64a91481afd91f9e5706a36eca7b5 (patch) | |
tree | e85efe1d6acc8b661a5c63974ec067007dc4ad11 /src/std | |
parent | 76d85a10f6cda93eba29dad5372e8160af7289c8 (diff) |
Fix scoped allocator alloc bug, do all processing in non-main threads. Main only join
Diffstat (limited to 'src/std')
-rw-r--r-- | src/std/scoped_allocator.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/std/scoped_allocator.c b/src/std/scoped_allocator.c index d53edad..deb9e1e 100644 --- a/src/std/scoped_allocator.c +++ b/src/std/scoped_allocator.c @@ -90,10 +90,11 @@ int scoped_allocator_alloc(ScopedAllocator *self, usize size, void **mem) { /* Reallocated (new node created) */ if(self->current != current) { *mem = self->current->data; + self->current->size += size; } else { *mem = align_ptr_ceil(self->current->data + self->current->size, 16); + self->current->size += alloc_size; } - self->current->size = size; return 0; } |