aboutsummaryrefslogtreecommitdiff
path: root/src/std/scoped_allocator.c
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2019-02-27 23:04:36 +0100
committerdec05eba <dec05eba@protonmail.com>2020-07-25 14:36:46 +0200
commit0ed62b9337c64a91481afd91f9e5706a36eca7b5 (patch)
treee85efe1d6acc8b661a5c63974ec067007dc4ad11 /src/std/scoped_allocator.c
parent76d85a10f6cda93eba29dad5372e8160af7289c8 (diff)
Fix scoped allocator alloc bug, do all processing in non-main threads. Main only join
Diffstat (limited to 'src/std/scoped_allocator.c')
-rw-r--r--src/std/scoped_allocator.c3
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;
}