summaryrefslogtreecommitdiff
path: root/src/backend/access/heap/heapam.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/access/heap/heapam.c')
-rw-r--r--src/backend/access/heap/heapam.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/backend/access/heap/heapam.c b/src/backend/access/heap/heapam.c
index 4d382a04338..225f9829f22 100644
--- a/src/backend/access/heap/heapam.c
+++ b/src/backend/access/heap/heapam.c
@@ -1133,7 +1133,7 @@ heap_beginscan(Relation relation, Snapshot snapshot,
*/
if (flags & SO_TYPE_BITMAPSCAN)
{
- BitmapHeapScanDesc bscan = palloc(sizeof(BitmapHeapScanDescData));
+ BitmapHeapScanDesc bscan = palloc_object(BitmapHeapScanDescData);
/*
* Bitmap Heap scans do not have any fields that a normal Heap Scan
@@ -1142,7 +1142,7 @@ heap_beginscan(Relation relation, Snapshot snapshot,
scan = (HeapScanDesc) bscan;
}
else
- scan = (HeapScanDesc) palloc(sizeof(HeapScanDescData));
+ scan = (HeapScanDesc) palloc_object(HeapScanDescData);
scan->rs_base.rs_rd = relation;
scan->rs_base.rs_snapshot = snapshot;
@@ -1201,7 +1201,7 @@ heap_beginscan(Relation relation, Snapshot snapshot,
* when doing a parallel scan.
*/
if (parallel_scan != NULL)
- scan->rs_parallelworkerdata = palloc(sizeof(ParallelBlockTableScanWorkerData));
+ scan->rs_parallelworkerdata = palloc_object(ParallelBlockTableScanWorkerData);
else
scan->rs_parallelworkerdata = NULL;
@@ -1210,7 +1210,7 @@ heap_beginscan(Relation relation, Snapshot snapshot,
* initscan() and we don't want to allocate memory again
*/
if (nkeys > 0)
- scan->rs_base.rs_key = (ScanKey) palloc(sizeof(ScanKeyData) * nkeys);
+ scan->rs_base.rs_key = palloc_array(ScanKeyData, nkeys);
else
scan->rs_base.rs_key = NULL;
@@ -2037,7 +2037,7 @@ GetBulkInsertState(void)
{
BulkInsertState bistate;
- bistate = (BulkInsertState) palloc(sizeof(BulkInsertStateData));
+ bistate = (BulkInsertState) palloc_object(BulkInsertStateData);
bistate->strategy = GetAccessStrategy(BAS_BULKWRITE);
bistate->current_buf = InvalidBuffer;
bistate->next_free = InvalidBlockNumber;
@@ -6895,7 +6895,7 @@ FreezeMultiXactId(MultiXactId multi, uint16 t_infomask,
* even member XIDs >= OldestXmin often won't be kept by second pass.
*/
nnewmembers = 0;
- newmembers = palloc(sizeof(MultiXactMember) * nmembers);
+ newmembers = palloc_array(MultiXactMember, nmembers);
has_lockers = false;
update_xid = InvalidTransactionId;
update_committed = false;
@@ -8711,7 +8711,7 @@ bottomup_sort_and_shrink(TM_IndexDeleteOp *delstate)
Assert(delstate->ndeltids > 0);
/* Calculate per-heap-block count of TIDs */
- blockgroups = palloc(sizeof(IndexDeleteCounts) * delstate->ndeltids);
+ blockgroups = palloc_array(IndexDeleteCounts, delstate->ndeltids);
for (int i = 0; i < delstate->ndeltids; i++)
{
TM_IndexDelete *ideltid = &delstate->deltids[i];