MCPcopy Create free account
hub / github.com/apache/cloudberry / remove_cache_entry

Function remove_cache_entry

src/backend/executor/nodeMemoize.c:346–368  ·  view source on GitHub ↗

* remove_cache_entry * Remove 'entry' from the cache and free memory used by it. */

Source from the content-addressed store, hash-verified

344 * Remove 'entry' from the cache and free memory used by it.
345 */
346static void
347remove_cache_entry(MemoizeState *mstate, MemoizeEntry *entry)
348{
349 MemoizeKey *key = entry->key;
350
351 dlist_delete(&entry->key->lru_node);
352
353 /* Remove all of the tuples from this entry */
354 entry_purge_tuples(mstate, entry);
355
356 /*
357 * Update memory accounting. entry_purge_tuples should have already
358 * subtracted the memory used for each cached tuple. Here we just update
359 * the amount used by the entry itself.
360 */
361 mstate->mem_used -= EMPTY_ENTRY_MEMORY_BYTES(entry);
362
363 /* Remove the entry from the cache */
364 memoize_delete_item(mstate->hashtable, entry);
365
366 pfree(key->params);
367 pfree(key);
368}
369
370/*
371 * cache_purge_all

Callers 1

cache_reduce_memoryFunction · 0.85

Calls 3

dlist_deleteFunction · 0.85
entry_purge_tuplesFunction · 0.85
pfreeFunction · 0.50

Tested by

no test coverage detected