package core:container/lru

⌘K
Ctrl+K
or
/

    Index

    Types (2)
    Constants (0)

    This section is empty.

    Variables (0)

    This section is empty.

    Procedure Groups (0)

    This section is empty.

    Types

    Cache ¶

    Cache :: struct($Key: typeid, $Value: typeid) where intrinsics.type_is_valid_map_key(Key) {}
     

    Cache is an LRU cache. It automatically removes entries as new entries are added if the capacity is reached. Entries are removed based on how recently they were used where the oldest entries are removed first.

    Related Procedures With Parameters

    Node ¶

    Node :: struct($Key: typeid, $Value: typeid) where intrinsics.type_is_valid_map_key(Key) {}

    Constants

    This section is empty.

    Variables

    This section is empty.

    Procedures

    clear ¶

    clear :: proc(c: ^$C/Cache($Key, $Value), call_on_remove: bool) {…}
     

    clear the contents of a Cache

    destroy ¶

    destroy :: proc(c: ^$C/Cache($Key, $Value), call_on_remove: bool) {…}
     

    destroy deinitializes a Cachem

    exists ¶

    exists :: proc(c: ^$C/Cache($Key, $Value), key: $T) -> bool {…}
     

    exists checks for the existence of a value from a given key without updating the recent usage.

    get ¶

    get :: proc(c: ^$C/Cache($Key, $Value), key: $T) -> (value: $T, ok: bool) #optional_ok {…}
     

    get a value from the cache from a given key. This operation updates the usage of the item.

    get_ptr ¶

    get_ptr :: proc(c: ^$C/Cache($Key, $Value), key: $T) -> (value: ^$T, ok: bool) #optional_ok {…}
     

    get_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/Cache($Key, $Value), capacity: int, entries_allocator := context.allocator, node_allocator := context.allocator) {…}
     

    init initializes a Cache

    peek ¶

    peek :: proc(c: ^$C/Cache($Key, $Value), key: $T) -> (value: $T, ok: bool) #optional_ok {…}
     

    peek gets the value from the cache from a given key without updating the recent usage.

    remove ¶

    remove :: proc(c: ^$C/Cache($Key, $Value), key: $T) -> bool {…}
     

    remove removes an item from the cache.

    set ¶

    set :: proc(c: ^$C/Cache($Key, $Value), key: $T, value: $T) -> runtime.Allocator_Error {…}
     

    set the given key value pair. This operation updates the recent usage of the item.

    Procedure Groups

    This section is empty.

    Source Files

    Generation Information

    Generated with odin version dev-2024-12 (vendor "odin") Windows_amd64 @ 2024-12-20 21:10:45.847492400 +0000 UTC