aboutsummaryrefslogtreecommitdiff
path: root/src/std
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2019-08-18 06:25:52 +0200
committerdec05eba <dec05eba@protonmail.com>2020-07-25 14:36:46 +0200
commitc1bea102df3f2907f345b89ff0f66f5055ac4767 (patch)
tree309d26329d190e24e9b4ebc36e89c42e369f0560 /src/std
parent81c5f8e750fcda6a2451fb54604130431434f88f (diff)
Add extern funcs, parameter registers, fix asm_rm RSP bug
Diffstat (limited to 'src/std')
-rw-r--r--src/std/arena_allocator.c3
-rw-r--r--src/std/hash_map.c10
2 files changed, 7 insertions, 6 deletions
diff --git a/src/std/arena_allocator.c b/src/std/arena_allocator.c
index 73111dd..4934925 100644
--- a/src/std/arena_allocator.c
+++ b/src/std/arena_allocator.c
@@ -25,9 +25,10 @@ void arena_allocator_node_deinit(ArenaAllocatorNode *self) {
}
int arena_allocator_init(ArenaAllocator *self) {
+ ignore_result_int(buffer_init(&self->mems, NULL));
return_if_error(arena_allocator_node_init(&self->head));
self->current = &self->head;
- return buffer_init(&self->mems, NULL);
+ return 0;
}
static void arena_allocator_deinit_buffers(ArenaAllocator *self) {
diff --git a/src/std/hash_map.c b/src/std/hash_map.c
index c2e42c1..2b29f2e 100644
--- a/src/std/hash_map.c
+++ b/src/std/hash_map.c
@@ -74,14 +74,14 @@ static void* bucket_node_get_value(HashMapBucketNode *self) {
}
int hash_map_init(HashMap *self, ArenaAllocator *allocator, usize value_type_size,
- HashMapCompare compare_func, HashMapHash hash_func) {
- assert(compare_func);
- assert(hash_func);
+ HashMapCompare key_compare_func, HashMapHash key_hash_func) {
+ assert(key_compare_func);
+ assert(key_hash_func);
self->allocator = allocator;
self->value_type_size = value_type_size;
self->num_elements = 0;
- self->compare_func = compare_func;
- self->hash_func = hash_func;
+ self->compare_func = key_compare_func;
+ self->hash_func = key_hash_func;
return_if_error(buffer_init(&self->buckets, self->allocator));
assert(self->buckets.size == 0);
return_if_error(buffer_append_empty(&self->buckets, sizeof(HashMapBucket) * HASH_MAP_INITIAL_SIZE));