From 0ed62b9337c64a91481afd91f9e5706a36eca7b5 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Wed, 27 Feb 2019 23:04:36 +0100 Subject: Fix scoped allocator alloc bug, do all processing in non-main threads. Main only join --- src/std/scoped_allocator.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/std/scoped_allocator.c') 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; } -- cgit v1.2.3