libfossil
fsl__bccache Struct Reference

#include "internal.h"

Collaboration diagram for fsl__bccache:

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.

Detailed Description

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.

Field Documentation

◆ capacity

uint16_t fsl__bccache::capacity

Number of allocated slots in this->list.

Definition at line 183 of file internal.h.

◆ changeMarker

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.

◆ hits

unsigned fsl__bccache::hits

Definition at line 211 of file internal.h.

◆ inCache

fsl_id_bag fsl__bccache::inCache

RIDs of all artifacts currently in the this->list cache.

Definition at line 204 of file internal.h.

◆ list

fsl__bccache_line* fsl__bccache::list

List of cached content, ordered by age.

Definition at line 199 of file internal.h.

◆ [struct]

struct { ... } fsl__bccache::metrics

Metrics solely for internal use in looking for optimizations.

These are only updated by fsl_content_get().

◆ misses

unsigned fsl__bccache::misses

Definition at line 212 of file internal.h.

◆ nextAge

fsl_uint_t fsl__bccache::nextAge

Next cache counter age.

Higher is newer.

Definition at line 187 of file internal.h.

◆ szLimit

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.

◆ szTotal

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.

◆ used

uint16_t fsl__bccache::used

Number of entries "used" in this->list.

Definition at line 170 of file internal.h.

◆ usedLimit

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.


The documentation for this struct was generated from the following file: