hash table impl

main
Patrick Cleavelin 2024-03-15 16:09:24 -05:00
parent 3e5d58fa72
commit 112d0bbb8e
2 changed files with 26 additions and 0 deletions

22
src/ht.h Normal file
View File

@ -0,0 +1,22 @@
// A simple/fast(?) hash table.
#ifndef ED_HT_INCLUDED
#define ED_HT_INCLUDED
#include <stddef.h>
#include <stdint.h>
#include "string.h"
// see <https://en.wikipedia.org/wiki/FowlerNollVo_hash_function>
#define FNV_OFFSET 14695981039346656037UL
#define FNV_PRIME 1099511628211UL
typedef struct {
} ed_ht_slot;
typedef struct {
ed_ht_slot *slots;
size_t capacity;
} ed_ht;
#endif

View File

@ -71,6 +71,10 @@ typedef struct {
size_t parent; size_t parent;
} ui_element_frame_data; } ui_element_frame_data;
typedef struct {
ed_ht *cached_elements;
} ui_context;
#endif #endif
#ifdef ED_UI_IMPLEMENTATION #ifdef ED_UI_IMPLEMENTATION