aboutsummaryrefslogtreecommitdiff
path: root/include/std/scoped_allocator.h
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2019-07-17 19:23:16 +0200
committerdec05eba <dec05eba@protonmail.com>2020-07-25 14:36:46 +0200
commit84e65c63e7482590d535e86f7660a00ae8a0cecb (patch)
treec79de87b7136e96b977003db85d43e5e676bbfc1 /include/std/scoped_allocator.h
parent85c654a102701958d3748e82ecac9c1bc4dbbcba (diff)
Start on amal program
Fix mutex issue in lhs expr which can cause a deadlock when a file has an error and throws and doesn't close the mutex and another thread waits for that mutex. The mutex can instead be removed and ignore race conditions which are uncommon. This should improve memory usage and performance.
Diffstat (limited to 'include/std/scoped_allocator.h')
-rw-r--r--include/std/scoped_allocator.h4
1 files changed, 0 insertions, 4 deletions
diff --git a/include/std/scoped_allocator.h b/include/std/scoped_allocator.h
index 60abcce..f037ea5 100644
--- a/include/std/scoped_allocator.h
+++ b/include/std/scoped_allocator.h
@@ -16,9 +16,6 @@ struct ScopedAllocator {
ScopedAllocatorNode head;
ScopedAllocatorNode *current;
Buffer/*<void*>*/ mems;
- /* TODO: Use linked-list instead, since the elements are dynamically allocated anyways */
- /* Find another way to store mutexes */
- Buffer/*<amal_mutex*>*/ mutexes;
};
CHECK_RESULT int scoped_allocator_node_init(ScopedAllocatorNode *self);
@@ -28,6 +25,5 @@ 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_mem(ScopedAllocator *self, usize *result_index);
-CHECK_RESULT int scoped_allocator_create_mutex(ScopedAllocator *self, amal_mutex **mutex);
#endif