Module cache_object

Module cache_object 

Source
Expand description

Cache object representation plus disk-backed serialization helpers used by the pack decoder to bound memory while still serving delta reconstruction quickly.

Structs§

ArcWrapper
Implementing encapsulation of Arc to enable third-party Trait HeapSize implementation for the Arc type Because of use Arc in LruCache, the LruCache is not clear whether a pointer will drop the referenced content when it is ejected from the cache, the actual memory usage is not accurate
CacheObject
Represents a cached object in memory, which may be a delta or a base object.

Traits§

ArcWrapperBounds
trait alias for simple use
FileLoadStore
file load&store trait
MemSizeRecorder
Heap-size recorder for a class(struct)
You should use a static Var to record mem-size and record mem-size after construction & minus it in drop()
So, variable-size fields in object should NOT be modified to keep heap-size stable.
Or, you can record the initial mem-size in this object
Or, update it (not impl)