jaemk / cached

Rust cache structures and easy function memoization
MIT License
1.58k stars 95 forks source link

I want to release the memory. again #25

Closed yagince closed 5 years ago

yagince commented 5 years ago

https://github.com/jaemk/cached/pull/24 In the above PullRequest, it was changed to release the memory when cache_clear was called. After that, the following PullRequest was merged and returned to the original. https://github.com/jaemk/cached/pull/23

I tried to implement it again. How is it?

yagince commented 5 years ago

@jaemk How is it?

jaemk commented 5 years ago

sorry I haven't been super responsive @yagince ! Could you break this logic out to a new trait method, maybe called cache_reset? That way it's clear whether you want to clear cached items or reset the cache to an empty state

yagince commented 5 years ago

Could you break this logic out to a new trait method, maybe called cache_reset? That way it's clear whether you want to clear cached items or reset the cache to an empty state

I understand, I think its better too. I will try.

yagince commented 5 years ago

@jaemk https://github.com/jaemk/cached/pull/25/commits/d4b8f3840f3aa928e93c93c2baabc6dce8de2723 how do you think this?

jaemk commented 5 years ago

looks good - thanks, @yagince !