diff options
author | dec05eba <dec05eba@protonmail.com> | 2019-07-31 01:25:05 +0200 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2020-07-25 14:36:46 +0200 |
commit | 1f28c3c733ea3ae4234bff91e1c55e61b1ee3e96 (patch) | |
tree | 0ab52e362da03fde741ce8159ef8a4110cd1fb6a /src/std/hash_map.c | |
parent | ec1a48e7b86fcd00127dd5a88d56c42083af1d78 (diff) |
Starting on asm, implementing extern function call so progress is visible
Diffstat (limited to 'src/std/hash_map.c')
-rw-r--r-- | src/std/hash_map.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/std/hash_map.c b/src/std/hash_map.c index 1ad0dea..bcb43eb 100644 --- a/src/std/hash_map.c +++ b/src/std/hash_map.c @@ -1,5 +1,5 @@ #include "../../include/std/hash_map.h" -#include "../../include/std/scoped_allocator.h" +#include "../../include/std/arena_allocator.h" #include "../../include/std/mem.h" #include <assert.h> @@ -73,7 +73,7 @@ static void* bucket_node_get_value(HashMapBucketNode *self) { return value; } -int hash_map_init(HashMap *self, ScopedAllocator *allocator, usize value_type_size, +int hash_map_init(HashMap *self, ArenaAllocator *allocator, usize value_type_size, HashMapCompare compare_func, HashMapHash hash_func) { assert(compare_func); assert(hash_func); @@ -91,7 +91,7 @@ int hash_map_init(HashMap *self, ScopedAllocator *allocator, usize value_type_si static CHECK_RESULT int hash_map_bucket_add(HashMap *self, HashMapBucket *bucket, BufferView key, void *value, usize hash) { HashMapBucketNode *new_bucket_node; - return_if_error(scoped_allocator_alloc(self->allocator, + return_if_error(arena_allocator_alloc(self->allocator, sizeof(HashMapBucketNode*) + sizeof(hash) + sizeof(u32) + key.size + self->value_type_size, (void**)&new_bucket_node)); bucket_node_set_next(new_bucket_node, bucket->start); |