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

Function repalloc_huge

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

* repalloc_huge * Adjust the size of a previously allocated chunk, permitting a large * value. The previous allocation need not have been "huge". */

Source from the content-addressed store, hash-verified

1487 * value. The previous allocation need not have been "huge".
1488 */
1489void *
1490repalloc_huge(void *pointer, Size size)
1491{
1492 MemoryContext context = GetMemoryChunkContext(pointer);
1493 void *ret;
1494
1495 if (!AllocHugeSizeIsValid(size))
1496 elog(ERROR, "invalid memory alloc request size %zu", size);
1497
1498 AssertNotInCriticalSection(context);
1499
1500 /* isReset must be false already */
1501 Assert(!context->isReset);
1502
1503 ret = context->methods->realloc(context, pointer, size);
1504 if (unlikely(ret == NULL))
1505 {
1506 MemoryContextStats(TopMemoryContext);
1507 ereport(ERROR,
1508 (errcode(ERRCODE_OUT_OF_MEMORY),
1509 errmsg("out of memory"),
1510 errdetail("Failed on request of size %zu in memory context \"%s\".",
1511 size, context->name)));
1512 }
1513
1514 VALGRIND_MEMPOOL_CHANGE(context, pointer, ret, size);
1515
1516 return ret;
1517}
1518
1519/*
1520 * MemoryContextStrdup

Callers 5

private_reallocFunction · 0.85
grow_memtuplesFunction · 0.85
grow_memtuplesFunction · 0.85
ginCombineDataFunction · 0.85
spi_printtupFunction · 0.85

Calls 5

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

Tested by

no test coverage detected