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

Function palloc0

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

Source from the content-addressed store, hash-verified

1328}
1329
1330void *
1331palloc0(Size size)
1332{
1333 /* duplicates MemoryContextAllocZero to avoid increased overhead */
1334 void *ret;
1335 MemoryContext context = CurrentMemoryContext;
1336
1337 AssertArg(MemoryContextIsValid(context));
1338 AssertNotInCriticalSection(context);
1339
1340 if (!AllocSizeIsValid(size))
1341 elog(ERROR, "invalid memory alloc request size %zu", size);
1342
1343 context->isReset = false;
1344
1345 ret = context->methods->alloc(context, size);
1346 if (unlikely(ret == NULL))
1347 {
1348 MemoryContextStats(TopMemoryContext);
1349 ereport(ERROR,
1350 (errcode(ERRCODE_OUT_OF_MEMORY),
1351 errmsg("out of memory"),
1352 errdetail("Failed on request of size %zu in memory context \"%s\".",
1353 size, context->name)));
1354 }
1355
1356 VALGRIND_MEMPOOL_ALLOC(context, ret, size);
1357
1358 MemSetAligned(ret, 0, size);
1359
1360 return ret;
1361}
1362
1363void *
1364palloc_extended(Size size, int flags)

Callers 15

rewriteTargetListIUFunction · 0.50
rewriteValuesRTEFunction · 0.50
generate_combinationsFunction · 0.50
statext_mcv_buildFunction · 0.50
statext_mcv_serializeFunction · 0.50
statext_mcv_deserializeFunction · 0.50
examine_attributeFunction · 0.50
examine_expressionFunction · 0.50

Calls 4

MemoryContextStatsFunction · 0.85
errcodeFunction · 0.50
errmsgFunction · 0.50
errdetailFunction · 0.50