summaryrefslogtreecommitdiff
path: root/src/backend/access/gin/gininsert.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/access/gin/gininsert.c')
-rw-r--r--src/backend/access/gin/gininsert.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/backend/access/gin/gininsert.c b/src/backend/access/gin/gininsert.c
index f87c60a230c..df30dcc0228 100644
--- a/src/backend/access/gin/gininsert.c
+++ b/src/backend/access/gin/gininsert.c
@@ -707,7 +707,7 @@ ginbuild(Relation heap, Relation index, IndexInfo *indexInfo)
{
SortCoordinate coordinate;
- coordinate = (SortCoordinate) palloc0(sizeof(SortCoordinateData));
+ coordinate = palloc0_object(SortCoordinateData);
coordinate->isWorker = false;
coordinate->nParticipants =
state->bs_leader->nparticipanttuplesorts;
@@ -791,7 +791,7 @@ ginbuild(Relation heap, Relation index, IndexInfo *indexInfo)
/*
* Return statistics
*/
- result = (IndexBuildResult *) palloc(sizeof(IndexBuildResult));
+ result = palloc_object(IndexBuildResult);
result->heap_tuples = reltuples;
result->index_tuples = buildstate.indtuples;
@@ -867,7 +867,7 @@ gininsert(Relation index, Datum *values, bool *isnull,
if (ginstate == NULL)
{
oldCtx = MemoryContextSwitchTo(indexInfo->ii_Context);
- ginstate = (GinState *) palloc(sizeof(GinState));
+ ginstate = palloc_object(GinState);
initGinState(ginstate, index);
indexInfo->ii_AmCache = ginstate;
MemoryContextSwitchTo(oldCtx);
@@ -934,7 +934,7 @@ _gin_begin_parallel(GinBuildState *buildstate, Relation heap, Relation index,
Size estsort;
GinBuildShared *ginshared;
Sharedsort *sharedsort;
- GinLeader *ginleader = (GinLeader *) palloc0(sizeof(GinLeader));
+ GinLeader *ginleader = palloc0_object(GinLeader);
WalUsage *walusage;
BufferUsage *bufferusage;
bool leaderparticipates = true;
@@ -1259,7 +1259,7 @@ AssertCheckGinBuffer(GinBuffer *buffer)
static GinBuffer *
GinBufferInit(Relation index)
{
- GinBuffer *buffer = palloc0(sizeof(GinBuffer));
+ GinBuffer *buffer = palloc0_object(GinBuffer);
int i,
nKeys;
TupleDesc desc = RelationGetDescr(index);
@@ -1273,7 +1273,7 @@ GinBufferInit(Relation index)
nKeys = IndexRelationGetNumberOfKeyAttributes(index);
- buffer->ssup = palloc0(sizeof(SortSupportData) * nKeys);
+ buffer->ssup = palloc0_array(SortSupportData, nKeys);
/*
* Lookup ordering operator for the index key data type, and initialize
@@ -2030,7 +2030,7 @@ _gin_parallel_scan_and_build(GinBuildState *state,
IndexInfo *indexInfo;
/* Initialize local tuplesort coordination state */
- coordinate = palloc0(sizeof(SortCoordinateData));
+ coordinate = palloc0_object(SortCoordinateData);
coordinate->isWorker = true;
coordinate->nParticipants = -1;
coordinate->sharedsort = sharedsort;
@@ -2279,7 +2279,7 @@ _gin_build_tuple(OffsetNumber attrnum, unsigned char category,
while (ncompressed < nitems)
{
int cnt;
- GinSegmentInfo *seginfo = palloc(sizeof(GinSegmentInfo));
+ GinSegmentInfo *seginfo = palloc_object(GinSegmentInfo);
seginfo->seg = ginCompressPostingList(&items[ncompressed],
(nitems - ncompressed),