void SectorCacheDump()
Print every row through printf().
void SetSectorRowLocked(SectorCacheRow *pRow)
Lock one row against reuse.
SectorCacheRow * SectorCacheFind(int nFile, int nSector)
Find the row buffering a chunk.
void SectorCacheLock(int nFile, int nSector)
Lock the row buffering a chunk against reuse.
SectorCache gSectorCache
The one sector cache.
constexpr int kSectorCacheRowEmpty
Stored in a row's file and sector while the row buffers nothing.
Definition seccache.h:10
void UnlockCachedSector(int nFile, int nSector)
Release the lock on the row buffering a chunk.
void SectorCacheRemove(int nFile)
Drop every row that buffers a file.
void SectorCacheInit(int nRows)
Bring up the sector cache.
constexpr unsigned kSectorCacheStampRebase
The amount every stamp above the halfway mark is reduced by.
Definition seccache.h:28
constexpr unsigned kSectorCacheStampCeiling
Stamp the least-recently-used search starts from, above every stamp the clock produces.
Definition seccache.h:22
constexpr unsigned kSectorCacheLocked
Stamp that locks a row against reuse.
Definition seccache.h:19
void SectorCacheTerm()
Release every row and the row table.
SectorCacheRow * SectorCacheGetLRU(int nFile, int nSector)
Take the least recently used row for a chunk.
constexpr int kSectorCacheFallbackSize
The space the cache assumes when zones are switched off.
Definition seccache.h:7
constexpr int kSectorCacheRowSize
The number of bytes each row buffers, which is what the row count divides the zone by.
Definition seccache.h:4
constexpr unsigned kSectorCacheStampHalfway
A chosen stamp above this triggers the rebase that stops the clock from wrapping.
Definition seccache.h:25
One buffered run of a file.
Definition seccache.h:36
int mFile
Definition seccache.h:37
int mSector
Definition seccache.h:38
unsigned mStamp
Definition seccache.h:39
void * mBuffer
Definition seccache.h:40
The row table and its length.
Definition seccache.h:161
int mRowCount
Definition seccache.h:162
SectorCacheRow * mRows
Definition seccache.h:163