<ahref="lru_8h.html">Go to the documentation of this file.</a><divclass="fragment"><divclass="line"><aid="l00001"name="l00001"></a><spanclass="lineno"> 1</span><spanclass="comment">//</span></div>
<divclass="line"><aid="l00002"name="l00002"></a><spanclass="lineno"> 2</span><spanclass="comment">// Created by claunia on 2/10/22.</span></div>
<divclass="ttc"id="alru_8h_html_a4c0693df23b76b54750218753a748223"><divclass="ttname"><ahref="lru_8h.html#a4c0693df23b76b54750218753a748223">add_to_cache_uint64</a></div><divclass="ttdeci">void add_to_cache_uint64(struct CacheHeader *cache, uint64_t key, void *value, size_t size)</div><divclass="ttdoc">Adds a value to the cache with a uint64_t key, evicting LRU entries if over budget.</div><divclass="ttdef"><b>Definition</b><ahref="lru_8c_source.html#l00068">lru.c:68</a></div></div>
<divclass="ttc"id="alru_8h_html_a8cb7ac8e057627210732ee61d2966e35"><divclass="ttname"><ahref="lru_8h.html#a8cb7ac8e057627210732ee61d2966e35">find_in_cache_uint64</a></div><divclass="ttdeci">void * find_in_cache_uint64(struct CacheHeader *cache, uint64_t key)</div><divclass="ttdoc">Finds a value in the cache by uint64_t key.</div><divclass="ttdef"><b>Definition</b><ahref="lru_8c_source.html#l00041">lru.c:41</a></div></div>
<divclass="ttc"id="alru_8h_html_a92e298695411672c3497ae5c8d9c0427"><divclass="ttname"><ahref="lru_8h.html#a92e298695411672c3497ae5c8d9c0427">free_cache</a></div><divclass="ttdeci">void free_cache(struct CacheHeader *cache)</div><divclass="ttdoc">Frees all entries in the cache and clears it.</div><divclass="ttdef"><b>Definition</b><ahref="lru_8c_source.html#l00118">lru.c:118</a></div></div>
<divclass="ttc"id="astructCacheEntry_html"><divclass="ttname"><ahref="structCacheEntry.html">CacheEntry</a></div><divclass="ttdoc">Single hash entry in the in-memory cache.</div><divclass="ttdef"><b>Definition</b><ahref="#l00024">lru.h:25</a></div></div>
<divclass="ttc"id="astructCacheEntry_html_a7d6d1ed0aab03cffbb34aff16f6f3d56"><divclass="ttname"><ahref="structCacheEntry.html#a7d6d1ed0aab03cffbb34aff16f6f3d56">CacheEntry::value</a></div><divclass="ttdeci">void * value</div><divclass="ttdoc">Opaque value pointer associated with key.</div><divclass="ttdef"><b>Definition</b><ahref="#l00027">lru.h:27</a></div></div>
<divclass="ttc"id="astructCacheEntry_html_ab7bea8f5ce4dc7ace006ccabd45a0d1f"><divclass="ttname"><ahref="structCacheEntry.html#ab7bea8f5ce4dc7ace006ccabd45a0d1f">CacheEntry::size</a></div><divclass="ttdeci">size_t size</div><divclass="ttdoc">Size in bytes of the memory pointed to by value.</div><divclass="ttdef"><b>Definition</b><ahref="#l00028">lru.h:28</a></div></div>
<divclass="ttc"id="astructCacheEntry_html_acee4cc303db10f54cfe2314142f24428"><divclass="ttname"><ahref="structCacheEntry.html#acee4cc303db10f54cfe2314142f24428">CacheEntry::key</a></div><divclass="ttdeci">uint64_t key</div><divclass="ttdoc">64-bit integer key (unique within the cache).</div><divclass="ttdef"><b>Definition</b><ahref="#l00026">lru.h:26</a></div></div>
<divclass="ttc"id="astructCacheEntry_html_ae7e5f03fa52b88d99e27e2433623b4f5"><divclass="ttname"><ahref="structCacheEntry.html#ae7e5f03fa52b88d99e27e2433623b4f5">CacheEntry::hh</a></div><divclass="ttdeci">UT_hash_handle hh</div><divclass="ttdoc">uthash handle (must remain per uthash docs).</div><divclass="ttdef"><b>Definition</b><ahref="#l00029">lru.h:29</a></div></div>
<divclass="ttc"id="astructCacheHeader_html"><divclass="ttname"><ahref="structCacheHeader.html">CacheHeader</a></div><divclass="ttdoc">Cache top-level descriptor encapsulating the hash table root and capacity limit.</div><divclass="ttdef"><b>Definition</b><ahref="#l00050">lru.h:51</a></div></div>
<divclass="ttc"id="astructCacheHeader_html_a44229bb929d8949f3c2700d07123d224"><divclass="ttname"><ahref="structCacheHeader.html#a44229bb929d8949f3c2700d07123d224">CacheHeader::cache</a></div><divclass="ttdeci">struct CacheEntry * cache</div><divclass="ttdoc">Hash root (uthash). NULL when empty.</div><divclass="ttdef"><b>Definition</b><ahref="#l00054">lru.h:54</a></div></div>
<divclass="ttc"id="astructCacheHeader_html_a54d553e78f5d90cce34ee684829a410f"><divclass="ttname"><ahref="structCacheHeader.html#a54d553e78f5d90cce34ee684829a410f">CacheHeader::free_func</a></div><divclass="ttdeci">void(*) free_func(void *)</div><divclass="ttdoc">Optional callback to free cached values. NULL if not needed.</div><divclass="ttdef"><b>Definition</b><ahref="#l00055">lru.h:55</a></div></div>
<divclass="ttc"id="astructCacheHeader_html_ae6521ccf8e75b0c9c70297af637b1eaa"><divclass="ttname"><ahref="structCacheHeader.html#ae6521ccf8e75b0c9c70297af637b1eaa">CacheHeader::cur_bytes</a></div><divclass="ttdeci">uint64_t cur_bytes</div><divclass="ttdoc">Bytes currently held by the cached values.</div><divclass="ttdef"><b>Definition</b><ahref="#l00053">lru.h:53</a></div></div>
<divclass="ttc"id="astructCacheHeader_html_af82718ebf5e59a398bc6e9428a389bb2"><divclass="ttname"><ahref="structCacheHeader.html#af82718ebf5e59a398bc6e9428a389bb2">CacheHeader::max_bytes</a></div><divclass="ttdeci">uint64_t max_bytes</div><divclass="ttdoc">Memory budget in bytes for the cached values. 0 means unlimited.</div><divclass="ttdef"><b>Definition</b><ahref="#l00052">lru.h:52</a></div></div>
<liclass="footer">Generated by <ahref="https://www.doxygen.org/index.html"><imgclass="footer"src="doxygen.svg"width="104"height="31"alt="doxygen"/></a> 1.18.0 </li>