MOS Source Code
|
A simple hashmap. More...
Topics | |
libs.HashMap.Common | |
Common hash and comparison functions for hashmaps. | |
Classes | |
struct | hashmap_t |
Typedefs | |
typedef hash_t(* | hashmap_hash_t) (const uintn key) |
typedef int(* | hashmap_key_compare_t) (const uintn key1, const uintn key2) |
A hashmap hash function prototype. | |
typedef bool(* | hashmap_foreach_func_t) (const uintn key, void *value, void *data) |
A hashmap key comparison function prototype. | |
typedef struct hashmap_entry | hashmap_entry_t |
A hashmap foreach callback function prototype. | |
Functions | |
MOSAPI void | hashmap_init (hashmap_t *map, size_t capacity, hashmap_hash_t hash_func, hashmap_key_compare_t compare_func) |
MOSAPI void | hashmap_deinit (hashmap_t *map) |
Deinitialize a hashmap. | |
MOSAPI void * | hashmap_put (hashmap_t *map, uintn key, void *value) |
MOSAPI void * | hashmap_get (hashmap_t *map, uintn key) |
MOSAPI void * | hashmap_remove (hashmap_t *map, uintn key) |
MOSAPI void | hashmap_foreach (hashmap_t *map, hashmap_foreach_func_t func, void *data) |
A simple hashmap.
typedef struct hashmap_entry hashmap_entry_t |
MOSAPI void hashmap_init | ( | hashmap_t * | map, |
size_t | capacity, | ||
hashmap_hash_t | hash_func, | ||
hashmap_key_compare_t | compare_func ) |
Definition at line 24 of file hashmap.c.
Referenced by inode_init(), ipc_init(), mountpoint_map_init(), and tasks_init().
Deinitialize a hashmap.
map | The hashmap to deinitialize. |
Definition at line 49 of file hashmap.c.
Referenced by __mos_test_wrapped_test_hashmap_foreach_function(), __mos_test_wrapped_test_hashmap_get_function(), __mos_test_wrapped_test_hashmap_init_simple_macro(), __mos_test_wrapped_test_hashmap_put_multiple(), __mos_test_wrapped_test_hashmap_put_overflow(), __mos_test_wrapped_test_hashmap_put_single(), and __mos_test_wrapped_test_hashmap_remove_function().
Definition at line 68 of file hashmap.c.
Referenced by __mos_test_wrapped_test_hashmap_foreach_function(), __mos_test_wrapped_test_hashmap_get_function(), __mos_test_wrapped_test_hashmap_put_multiple(), __mos_test_wrapped_test_hashmap_put_overflow(), __mos_test_wrapped_test_hashmap_put_single(), __mos_test_wrapped_test_hashmap_remove_function(), dentry_mount(), ipc_connect_to_server(), kthread_init(), pagecache_get_page_for_read(), process_do_fork(), process_new(), and thread_complete_init().
Definition at line 96 of file hashmap.c.
Referenced by __mos_test_wrapped_test_hashmap_get_function(), __mos_test_wrapped_test_hashmap_put_multiple(), __mos_test_wrapped_test_hashmap_put_overflow(), __mos_test_wrapped_test_hashmap_put_single(), __mos_test_wrapped_test_hashmap_remove_function(), dentry_get_mount(), ipc_connect_to_server(), ipc_server_close(), ipc_server_create(), pagecache_flush_or_drop(), pagecache_get_page_for_read(), process_get(), and thread_get().
Definition at line 117 of file hashmap.c.
Referenced by __mos_test_wrapped_test_hashmap_remove_function(), dentry_unmount(), do_flush_and_drop_cached_page(), process_destroy(), process_exit(), and thread_destroy().
MOSAPI void hashmap_foreach | ( | hashmap_t * | map, |
hashmap_foreach_func_t | func, | ||
void * | data ) |
Definition at line 146 of file hashmap.c.
Referenced by __mos_test_wrapped_test_hashmap_foreach_function(), ipc_sysfs_dump_name_waitlist(), pagecache_flush_or_drop_all(), tasks_sysfs_process_list(), and tasks_sysfs_thread_list().