From 1f28c3c733ea3ae4234bff91e1c55e61b1ee3e96 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Wed, 31 Jul 2019 01:25:05 +0200 Subject: Starting on asm, implementing extern function call so progress is visible --- src/std/hash_map.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/std/hash_map.c') 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 @@ -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); -- cgit v1.2.3