20#define MAP_MIN_CAPACITY 16
25#define MAP_MAX_LOAD_PERCENTAGE 75
30#define MAP_TOMBSTONE ((map_entry_t*)1)
35#define MAP_KEY_MAX_LENGTH 40
67#define MAP_ENTRY_PTR_IS_VALID(entryPtr) ((entryPtr) != NULL && (entryPtr) != MAP_TOMBSTONE)
#define assert(expression)
uint64_t hash_object(const void *object, uint64_t length)
Hash a object.
static map_key_t map_key_buffer(const void *buffer, uint64_t length)
Create a map key from a buffer.
uint64_t map_capacity(const map_t *map)
Get the capacity of the map.
bool map_contains(map_t *map, const map_key_t *key)
Check if the map contains a key.
void map_clear(map_t *map)
Clear all entries from the map.
void map_deinit(map_t *map)
Deinitialize a map.
#define MAP_KEY_MAX_LENGTH
The maximum length of a key in the map.
void map_entry_init(map_entry_t *entry)
Initialize a map entry.
static map_key_t map_key_uint64(uint64_t uint64)
Create a map key from a uint64_t.
uint64_t map_size(const map_t *map)
Get the number of entries in the map.
uint64_t map_insert(map_t *map, const map_key_t *key, map_entry_t *value)
Insert a key-value pair into the map.
uint64_t map_init(map_t *map)
Initialize a map.
void map_remove(map_t *map, const map_key_t *key)
Remove a key-value pair from the map.
bool map_is_empty(const map_t *map)
Check if the map is empty.
map_entry_t * map_get(map_t *map, const map_key_t *key)
Get a value from the map by key.
uint64_t map_reserve(map_t *map, uint64_t minCapacity)
Reserve space in the map for at least minCapacity entries.
static map_key_t map_key_string(const char *str)
Create a map key from a string.
EFI_PHYSICAL_ADDRESS buffer
_PUBLIC void * memcpy(void *_RESTRICT s1, const void *_RESTRICT s2, size_t n)
_PUBLIC size_t strlen(const char *s)
uint8_t key[MAP_KEY_MAX_LENGTH]