libfossil
fsl__mcache Struct Reference

#include "internal.h"

Collaboration diagram for fsl__mcache:

Data Fields

fsl_uint_t aAge [4]
 The virtual age of each deck in the cache.
fsl_deck decks [4]
 Stores bitwise copies of decks.
unsigned hits
 Counts the number of cache hits.
unsigned misses
 Counts the number of cache misses.
fsl_uint_t nextAge
 Next age value.

Detailed Description

Very internal.

"Manifest cache" for fsl_deck entries encountered during crosslinking. This type is intended only to be embedded in fsl_cx.

The routines for managing this cache are static in deck.c: fsl__cx_mcache_insert() and fsl__cx_mcache_search().

The array members in this struct MUST have the same length or results are undefined.

Definition at line 245 of file internal.h.

Field Documentation

◆ aAge

fsl_uint_t fsl__mcache::aAge[4]

The virtual age of each deck in the cache.

They get evicted oldest first.

Definition at line 255 of file internal.h.

◆ decks

fsl_deck fsl__mcache::decks[4]

Stores bitwise copies of decks.

Storing a fsl_deck_malloc() deck into the cache requires bitwise-copying is contents, wiping out its contents via assignment from fsl_deck_empty, then fsl_free()'ing it (as opposed to fsl_deck_finalize(), which would attempt to clean up memory which now belongs to the cache's copy).

Array sizes of 6 and 10 do not appreciably change the hit rate compared to 4, at least not for current (2021-11-18) uses.

Definition at line 267 of file internal.h.

◆ hits

unsigned fsl__mcache::hits

Counts the number of cache hits.

Definition at line 250 of file internal.h.

◆ misses

unsigned fsl__mcache::misses

Counts the number of cache misses.

Definition at line 252 of file internal.h.

◆ nextAge

fsl_uint_t fsl__mcache::nextAge

Next age value.

No clue how the cache will react once this overflows.

Definition at line 248 of file internal.h.


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