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

Function CatCacheFreeKeys

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

* Helper routine that frees keys stored in the keys array. */

Source from the content-addressed store, hash-verified

1975 * Helper routine that frees keys stored in the keys array.
1976 */
1977static void
1978CatCacheFreeKeys(TupleDesc tupdesc, int nkeys, int *attnos, Datum *keys)
1979{
1980 int i;
1981
1982 for (i = 0; i < nkeys; i++)
1983 {
1984 int attnum = attnos[i];
1985 Form_pg_attribute att;
1986
1987 /* system attribute are not supported in caches */
1988 Assert(attnum > 0);
1989
1990 att = TupleDescAttr(tupdesc, attnum - 1);
1991
1992 if (!att->attbyval)
1993 pfree(DatumGetPointer(keys[i]));
1994 }
1995}
1996
1997/*
1998 * Helper routine that copies the keys in the srckeys array into the dstkeys

Callers 2

CatCacheRemoveCTupFunction · 0.85
CatCacheRemoveCListFunction · 0.85

Calls 1

pfreeFunction · 0.50

Tested by

no test coverage detected