MCPcopy Create free account
hub / github.com/andysworkshop/stm32plus / CachedBlockDevice

Method CachedBlockDevice

lib/src/device/CachedBlockDevice.cpp:20–32  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

18 */
19
20 CachedBlockDevice::CachedBlockDevice(BlockDevice& bd,uint32_t numCachedBlocks) :
21 _device(bd), _numCachedBlocks(numCachedBlocks), _blockSize(bd.getBlockSizeInBytes()) {
22 uint32_t i;
23
24 _cachedBlocks=new uint8_t *[numCachedBlocks];
25 _cacheIndex=new CacheEntry[numCachedBlocks];
26
27 for(i=0;i<numCachedBlocks;i++) {
28 _cachedBlocks[i]=new uint8_t[_blockSize];
29 _cacheIndex[i].BlockIndex=FREE_CACHE_ENTRY;
30 _cacheIndex[i].CacheIndex=i;
31 }
32 }
33
34 /**
35 * Destructor. Free memory allocated by the cache.

Callers

nothing calls this directly

Calls 1

getBlockSizeInBytesMethod · 0.45

Tested by

no test coverage detected