core/container/lru
container_lru
Types
2Procedures
9clear
clear :: proc(c: ^C, call_on_remove: bool)Sourceclear the contents of a Cache
destroy
destroy :: proc(c: ^C, call_on_remove: bool)Sourcedestroy deinitializes a Cachem
exists
exists :: proc(c: ^C, key: Key) -> (bool)Sourceexists checks for the existence of a value from a given key without updating the recent usage.
get
get :: proc(c: ^C, key: Key) -> (value: Value, ok: bool)Sourceget a value from the cache from a given key. This operation updates the usage of the item.
get_ptr
get_ptr :: proc(c: ^C, key: Key) -> (value: ^Value, ok: bool)Sourceget_ptr gets the pointer to a value the cache from a given key. This operation updates the usage of the item.
init
init :: proc(c: ^C, capacity: int, entries_allocator: mem.Allocator = context.allocator, node_allocator: mem.Allocator = context.allocator)Sourceinit initializes a Cache
peek
peek :: proc(c: ^C, key: Key) -> (value: Value, ok: bool)Sourcepeek gets the value from the cache from a given key without updating the recent usage.
remove
remove :: proc(c: ^C, key: Key) -> (bool)Sourceremove removes an item from the cache.
set
set :: proc(c: ^C, key: Key, value: Value) -> (runtime.Allocator_Error)Sourceset the given key value pair. This operation updates the recent usage of the item.