This is the lru-cache Reference Manual, version 1.0.0, generated automatically by Declt version 4.0 beta 2 "William Riker" on Sun Dec 15 06:54:46 2024 GMT+0.
The main system appears first, followed by any subsystem dependency.
lru-cache
A least-recently-used cache structure
Yukari Hafner <shinmera@tymoon.eu>
Yukari Hafner <shinmera@tymoon.eu>
(GIT https://github.com/shinmera/lru-cache.git)
zlib
1.0.0
documentation-utils
(system).
lru-cache.lisp
(file).
documentation.lisp
(file).
Files are sorted by type and then listed depth-first from the systems components trees.
lru-cache/lru-cache.lisp
lru-cache
(system).
describe-object
(method).
do-lru-cache
(macro).
lru-cache
(structure).
lru-cache-clear
(function).
lru-cache-count
(function).
lru-cache-evict
(function).
lru-cache-id
(function).
lru-cache-list
(function).
lru-cache-pop
(function).
lru-cache-push
(function).
lru-cache-resize
(function).
lru-cache-size
(reader).
(setf lru-cache-size)
(writer).
make-lru-cache
(function).
map-lru-cache
(function).
print-object
(method).
print-object
(method).
%make-lru-cache
(function).
check-lru-cache
(function).
lru-cache-head
(reader).
(setf lru-cache-head)
(writer).
lru-cache-node
(structure).
lru-cache-node-id
(reader).
(setf lru-cache-node-id)
(writer).
lru-cache-node-left
(reader).
(setf lru-cache-node-left)
(writer).
lru-cache-node-right
(reader).
(setf lru-cache-node-right)
(writer).
lru-cache-node-value
(reader).
(setf lru-cache-node-value)
(writer).
lru-cache-table
(reader).
(setf lru-cache-table)
(writer).
make-lru-cache-node
(function).
lru-cache/documentation.lisp
lru-cache.lisp
(file).
lru-cache
(system).
Packages are listed by definition order.
org.shirakumo.lru-cache
common-lisp
.
do-lru-cache
(macro).
lru-cache
(structure).
lru-cache-clear
(function).
lru-cache-count
(function).
lru-cache-evict
(function).
lru-cache-id
(function).
lru-cache-list
(function).
lru-cache-pop
(function).
lru-cache-push
(function).
lru-cache-resize
(function).
lru-cache-size
(reader).
(setf lru-cache-size)
(writer).
make-lru-cache
(function).
map-lru-cache
(function).
%make-lru-cache
(function).
check-lru-cache
(function).
lru-cache-head
(reader).
(setf lru-cache-head)
(writer).
lru-cache-node
(structure).
lru-cache-node-id
(reader).
(setf lru-cache-node-id)
(writer).
lru-cache-node-left
(reader).
(setf lru-cache-node-left)
(writer).
lru-cache-node-right
(reader).
(setf lru-cache-node-right)
(writer).
lru-cache-node-value
(reader).
(setf lru-cache-node-value)
(writer).
lru-cache-table
(reader).
(setf lru-cache-table)
(writer).
make-lru-cache-node
(function).
Definitions are sorted by export status, category, package, and then by lexicographic order.
Convenience macro to iterate over the cached elements in order from most recent to least recent.
An implicit NIL block is bound around BODY.
If BODY does not explicitly return, RESULT is evaluated and returned instead.
See LRU-CACHE
See MAP-LRU-CACHE
Evicts all elements in the cache and clears it.
This operation is O(n).
See LRU-CACHE
Counts the number of elements currently in the cache.
This operation is O(n).
See LRU-CACHE
See LRU-CACHE-SIZE
Evicts the least recently used element from the cache.
Returns the element and the ID of the evicted node, if any.
This operation is O(n).
See LRU-CACHE
Returns the ID of the node the element is in.
If the element is not in the cache, NIL is returned.
This operation is O(1).
See LRU-CACHE
Returns a list of the elements in the cache in order of most recent to least recent.
See LRU-CACHE
See MAP-LRU-CACHE
Pops an element out of the cache.
If the element exists in the cache, the ID of the node is returned. If
the element did not exist in the cache, NIL is returned.
This operation is O(1).
See LRU-CACHE
See LRU-CACHE-PUSH
Pushes an element to the cache.
The element is put into the cache as the most recently used. If the
element did not exist before and the cache is already full, the least
recently used element is evicted.
Returns the ID of the node the element was put into, if it was not
already in the cache. If the element was already in the cache, NIL is
returned.
This operation is O(1).
See LRU-CACHE
See LRU-CACHE-POP
Change the size of the cache.
When decreasing the cache size, elements are *not* evicted according to LRU order, and instead elements with the largest assigned ID are evicted in order. This is required to ensure that the IDs remain consecutive and consistent across multiple shrinkages and growths.
If preserving LRU order is more important than preserving node IDs
when shrinking, you should first coerce the cache to a sequence, then
resize and reinsert in reverse order.
This operation is O(n) for increasing the size and O(n^2) for
decreasing the size.
See LRU-CACHE
See LRU-CACHE-SIZE
Returns the size of the cache.
This operation is O(1).
See LRU-CACHE
See LRU-CACHE-RESIZE
size
.
Create a new LRU-CACHE instance that can hold SIZE elements.
The TEST may be one of the arguments acceptable as the TEST of a
hash-table.
See CL:HASH-TABLE-TEST
See LRU-CACHE
Iterates over the cached elements in order from most recent to least recent.
Calls FUNCTION with two values: the element and the ID of the node the
element occupies. Note that the ID does *not* necessarily correspond
to the index of the node in the cache sequence.
Returns the CACHE instance.
See LRU-CACHE
See DO-LRU-CACHE
lru-cache-node
) stream) ¶A least-recently-used cache datastructure.
See MAKE-LRU-CACHE
See LRU-CACHE-RESIZE
See LRU-CACHE-SIZE
See LRU-CACHE-PUSH
See LRU-CACHE-POP
See LRU-CACHE-ID
See LRU-CACHE-EVICT
See LRU-CACHE-CLEAR
See LRU-CACHE-COUNT
See MAP-LRU-CACHE
See DO-LRU-CACHE
See LRU-CACHE-LIST
head
.
id
.
left
.
Jump to: | %
(
C D F L M P |
---|
Jump to: | %
(
C D F L M P |
---|
Jump to: | H I L R S T V |
---|
Jump to: | H I L R S T V |
---|
Jump to: | D F L O P S |
---|
Jump to: | D F L O P S |
---|