|
libfossil
|
#include "internal.h"
Data Fields | |
| uint16_t | capacity |
| Number of allocated slots in this->list. | |
| unsigned | changeMarker |
| Gets incremented on each insert for purposes of invalidating this cache. | |
| fsl_id_bag | inCache |
| RIDs of all artifacts currently in the this->list cache. | |
| fsl__bccache_line * | list |
| List of cached content, ordered by age. | |
| struct { | |
| unsigned hits | |
| unsigned misses | |
| } | metrics |
| Metrics solely for internal use in looking for optimizations. | |
| fsl_uint_t | nextAge |
| Next cache counter age. | |
| unsigned | szLimit |
| Limit on the (approx.) amount of memory (in bytes) which can be taken up by the cached buffers at one time. | |
| unsigned | szTotal |
| Total amount of buffer memory (in bytes) used by cached content. | |
| uint16_t | used |
| Number of entries "used" in this->list. | |
| uint16_t | usedLimit |
| Approximate upper limit on the number of entries in this->list. | |
A cache for tracking the existence of blobs while the internal goings-on of fsl_content_get() and friends are going on.
"bc" ==> blob cache.
Historically fossil caches artifacts as their blob content, but libfossil will likely (at some point) to instead cache fsl_deck instances, which contain all of the same data in pre-parsed form. It cost more memory, though. That approach also precludes caching non-structural artifacts (i.e. opaque client blobs).
Potential TODO: the limits of the cache size are currently hard-coded and changing them "by hand" won't have much effect. We should possibly have an API to tweak these limits.
Definition at line 155 of file internal.h.
| uint16_t fsl__bccache::capacity |
Number of allocated slots in this->list.
Definition at line 183 of file internal.h.
| unsigned fsl__bccache::changeMarker |
Gets incremented on each insert for purposes of invalidating this cache.
See the notes for fsl__ptl::changeMarker. It's okay if this overflows.
Definition at line 194 of file internal.h.
| unsigned fsl__bccache::hits |
Definition at line 211 of file internal.h.
| fsl_id_bag fsl__bccache::inCache |
RIDs of all artifacts currently in the this->list cache.
Definition at line 204 of file internal.h.
| fsl__bccache_line* fsl__bccache::list |
List of cached content, ordered by age.
Definition at line 199 of file internal.h.
| struct { ... } fsl__bccache::metrics |
Metrics solely for internal use in looking for optimizations.
These are only updated by fsl_content_get().
| unsigned fsl__bccache::misses |
Definition at line 212 of file internal.h.
| fsl_uint_t fsl__bccache::nextAge |
| unsigned fsl__bccache::szLimit |
Limit on the (approx.) amount of memory (in bytes) which can be taken up by the cached buffers at one time.
Fossil's historical value is 50M.
Definition at line 166 of file internal.h.
| unsigned fsl__bccache::szTotal |
Total amount of buffer memory (in bytes) used by cached content.
This does not account for memory held by this->list.
Definition at line 160 of file internal.h.
| uint16_t fsl__bccache::used |
Number of entries "used" in this->list.
Definition at line 170 of file internal.h.
| uint16_t fsl__bccache::usedLimit |
Approximate upper limit on the number of entries in this->list.
This limit may be violated slightly.
This list gets searched linearly so this number should ideally be relatively small: 3 digits or less. Fossil's historical value is 500.
Definition at line 179 of file internal.h.