Charles Hixson
Difference (last edit) (Author, normal page display)
Deleted: 10,21d9
==Warnings & Limitations:== nodeId is kept as a ushort. Even though it's periodically reduced when the cache is flushed, this doesn't reset it. A routine is needed to renumber the cache nodes, but I haven't thought of a quick way to do this. For many uses this would mean that a cache could only be used for a short period of time. (Perhaps after the cache is flushed I should just arbitrarily renumber the entries from 1-n? Or whenever the maxT value gets within maxSize+1 of ushort.max? At this point I haven't decided on what the best solution is. (The nodeId could also be made a ulong, which would postpone the problem for quite awhile, though it wouldn't solve it in principle.) This code is released under the MIT license. If you want something else, ask. [[code][linenumber=1][linenumberformat=%03d ] ] |
This is possibly useful code that I am contributing.
So far there's just this one piece of code:
LRUCache
This is a "Least Recently Used Cache", that has a maximum size, and when the size is exceeded, it deletes the least recently used entries.