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

Function MemoryContextContainsGenericAllocation

src/backend/utils/mmgr/mcxt.c:975–985  ·  view source on GitHub ↗

* MemoryContextContainsGenericAllocation * * Detects whether a generic (may or may not be allocated by palloc) chunk of * memory belongs to a given context or not. Note, the "generic" means it will * be ready to handle chunks not allocated using palloc, not at the start of an * allocated region, and not necessarily aligned. * * Currently only supports AllocSet, will error out if called on

Source from the content-addressed store, hash-verified

973 * performance implications before proceeding is recommended.
974 */
975bool
976MemoryContextContainsGenericAllocation(MemoryContext context, void *pointer)
977{
978 if (context->type != T_AllocSetContext)
979 MemoryContextError(ERRCODE_INTERNAL_ERROR,
980 context, CDB_MCXT_WHERE(context),
981 "MemoryContextContainsGenericAllocation is not available for type %u",
982 context->type);
983
984 return AllocSetContains(context, pointer);
985}
986
987/*--------------------
988 * MemoryContextCreate

Calls 2

MemoryContextErrorFunction · 0.85
AllocSetContainsFunction · 0.85