From 1b68fdcf5aebf2bc53bbd9234c77aea243c0decd Mon Sep 17 00:00:00 2001 From: dec05eba Date: Thu, 25 Apr 2019 23:32:23 +0200 Subject: Fix scoped allocator deinit crash with buffers --- include/std/scoped_allocator.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'include/std/scoped_allocator.h') diff --git a/include/std/scoped_allocator.h b/include/std/scoped_allocator.h index d7ec1e1..60abcce 100644 --- a/include/std/scoped_allocator.h +++ b/include/std/scoped_allocator.h @@ -15,9 +15,9 @@ struct ScopedAllocatorNode { struct ScopedAllocator { ScopedAllocatorNode head; ScopedAllocatorNode *current; + Buffer/**/ mems; /* TODO: Use linked-list instead, since the elements are dynamically allocated anyways */ /* Find another way to store mutexes */ - Buffer/**/ buffers; Buffer/**/ mutexes; }; @@ -27,7 +27,7 @@ void scoped_allocator_node_deinit(ScopedAllocatorNode *self); CHECK_RESULT int scoped_allocator_init(ScopedAllocator *self); void scoped_allocator_deinit(ScopedAllocator *self); CHECK_RESULT int scoped_allocator_alloc(ScopedAllocator *self, usize size, void **mem); -CHECK_RESULT int scoped_allocator_add_buffer(ScopedAllocator *self, Buffer *buffer); +CHECK_RESULT int scoped_allocator_add_mem(ScopedAllocator *self, usize *result_index); CHECK_RESULT int scoped_allocator_create_mutex(ScopedAllocator *self, amal_mutex **mutex); #endif -- cgit v1.2.3