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

Function CatCacheRemoveCList

src/backend/utils/cache/catcache.c:499–531  ·  view source on GitHub ↗

* CatCacheRemoveCList * * Unlink and delete the given cache list entry * * NB: any dead member entries that become unreferenced are deleted too. */

Source from the content-addressed store, hash-verified

497 * NB: any dead member entries that become unreferenced are deleted too.
498 */
499static void
500CatCacheRemoveCList(CatCache *cache, CatCList *cl)
501{
502 int i;
503
504 Assert(cl->refcount == 0);
505 Assert(cl->my_cache == cache);
506
507 /* delink from member tuples */
508 for (i = cl->n_members; --i >= 0;)
509 {
510 CatCTup *ct = cl->members[i];
511
512 Assert(ct->c_list == cl);
513 ct->c_list = NULL;
514 /* if the member is dead and now has no references, remove it */
515 if (
516#ifndef CATCACHE_FORCE_RELEASE
517 ct->dead &&
518#endif
519 ct->refcount == 0)
520 CatCacheRemoveCTup(cache, ct);
521 }
522
523 /* delink from linked list */
524 dlist_delete(&cl->cache_elem);
525
526 /* free associated column data */
527 CatCacheFreeKeys(cache->cc_tupdesc, cl->nkeys,
528 cache->cc_keyno, cl->keys);
529
530 pfree(cl);
531}
532
533
534/*

Callers 4

CatCacheRemoveCTupFunction · 0.85
CatCacheInvalidateFunction · 0.85
ResetCatalogCacheFunction · 0.85
ReleaseCatCacheListFunction · 0.85

Calls 4

CatCacheRemoveCTupFunction · 0.85
dlist_deleteFunction · 0.85
CatCacheFreeKeysFunction · 0.85
pfreeFunction · 0.50

Tested by

no test coverage detected