From b35b3e1bf70bf764940498247b1db5bb02761160 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Tue, 12 Mar 2019 01:27:54 +0100 Subject: Starting on ssa --- include/std/buffer.h | 2 +- include/std/hash_map.h | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'include/std') diff --git a/include/std/buffer.h b/include/std/buffer.h index 688f18a..c961b6e 100644 --- a/include/std/buffer.h +++ b/include/std/buffer.h @@ -3,6 +3,7 @@ #include "types.h" #include "misc.h" +#include "defs.h" #define BUFFER_OK 0 #define BUFFER_ALLOC_FAIL -1 @@ -13,7 +14,6 @@ typedef struct { usize capacity; } Buffer; -struct ScopedAllocator; CHECK_RESULT int buffer_init(Buffer *self, struct ScopedAllocator *allocator); /* @data can be NULL */ diff --git a/include/std/hash_map.h b/include/std/hash_map.h index c36ecc4..97b0745 100644 --- a/include/std/hash_map.h +++ b/include/std/hash_map.h @@ -15,21 +15,21 @@ typedef usize(*HashMapHash)(const u8 *data, usize size); struct HashMap { ScopedAllocator *allocator; /* borrowed */ Buffer/*HashMapBucket*/ buckets; - usize type_size; + usize value_type_size; usize num_elements; HashMapCompare compare_func; HashMapHash hash_func; }; -CHECK_RESULT int hash_map_init(HashMap *self, ScopedAllocator *allocator, usize type_size, HashMapCompare compare_func, HashMapHash hash_func); +CHECK_RESULT int hash_map_init(HashMap *self, ScopedAllocator *allocator, usize value_type_size, HashMapCompare compare_func, HashMapHash hash_func); /* Not thread-safe. -Expected @value size to be @self->type_size. +Expected @value size to be @self->value_type_size. */ CHECK_RESULT int hash_map_insert(HashMap *self, BufferView key, void *value); /* Thread-safe unless @hash_map_insert is used in another thread at the same time. -Expected @value size to be @self->type_size. +Expected @value size to be @self->value_type_size. */ CHECK_RESULT bool hash_map_get(HashMap *self, BufferView key, void *value); -- cgit v1.2.3