Inspiravetion / Memoirs

Memoirization Functions for Rust
0 stars 2 forks source link

Think about other cache backends #3

Open Inspiravetion opened 9 years ago

Inspiravetion commented 9 years ago

currently we use HashMap<Args, Result> which grows indefinately...think about providing a LRU/MRU cache backed version with a set size for areliable memory imprint

Inspiravetion commented 9 years ago

maybe provide a version that lets users specify their cache policy

Inspiravetion commented 9 years ago

need to add another possibility for the syntax extension...mayb one that asks for an expression that instantiates a new backend?...that way you can inject that expr into the constructor of the generated type

memoize!(memoirs::LRUCacheBackend::new(10),
    fn foo(){
        ...
    }
)