aboutsummaryrefslogtreecommitdiff
path: root/include/std/scoped_allocator.h
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2019-03-22 20:48:40 +0100
committerdec05eba <dec05eba@protonmail.com>2020-07-25 14:36:46 +0200
commit4f308829ad0e81a59971e172284c018cf2bdca3d (patch)
treeeb11a69a471e31aa7be8e46bce6d1b3ded28e056 /include/std/scoped_allocator.h
parent5df7f92e715ba764ee57f65d78e73111492bb64c (diff)
Add mutex for lhs expr, add error for missing lhs expr for func, struct
TODO: Use mutex in lhs expr and set resolved_type
Diffstat (limited to 'include/std/scoped_allocator.h')
-rw-r--r--include/std/scoped_allocator.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/include/std/scoped_allocator.h b/include/std/scoped_allocator.h
index 9090767..d7ec1e1 100644
--- a/include/std/scoped_allocator.h
+++ b/include/std/scoped_allocator.h
@@ -15,7 +15,10 @@ struct ScopedAllocatorNode {
struct ScopedAllocator {
ScopedAllocatorNode head;
ScopedAllocatorNode *current;
+ /* TODO: Use linked-list instead, since the elements are dynamically allocated anyways */
+ /* Find another way to store mutexes */
Buffer/*<Buffer*>*/ buffers;
+ Buffer/*<amal_mutex*>*/ mutexes;
};
CHECK_RESULT int scoped_allocator_node_init(ScopedAllocatorNode *self);
@@ -25,5 +28,6 @@ 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_create_mutex(ScopedAllocator *self, amal_mutex **mutex);
#endif