Injected LRU capabilities that simply:

* ensures that when an item is added, if the number of unexpired items
>= maximum number of items specified, the oldest (based on ACCESS) is
expired
* when an item is "gotten", or "set", the access time is updated

The existing janitor system is unchanged, and used to actually delete
the items.

The only change from a consumer standpoint, is one addition parameter at
the end of a "New" call, that specifies the maximum number of items to
allow, or 0, if you want to disable the LRU at all.
This commit is contained in:
Matt Keller
2015-02-27 15:57:16 -05:00
parent 03284ca422
commit f66ee0bbc6
3 changed files with 283 additions and 89 deletions
+1
View File
@@ -6,3 +6,4 @@ code was contributed.)
Dustin Sallings <dustin@spy.net>
Jason Mooberry <jasonmoo@me.com>
Sergey Shepelev <temotor@gmail.com>
Matthew Keller <m@cognusion.com>