summaryrefslogtreecommitdiff
path: root/src/backend/lib
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/lib')
-rw-r--r--src/backend/lib/bipartite_match.c2
-rw-r--r--src/backend/lib/dshash.c4
-rw-r--r--src/backend/lib/integerset.c2
-rw-r--r--src/backend/lib/pairingheap.c2
-rw-r--r--src/backend/lib/rbtree.c2
5 files changed, 6 insertions, 6 deletions
diff --git a/src/backend/lib/bipartite_match.c b/src/backend/lib/bipartite_match.c
index 5af789652c7..ed54f190494 100644
--- a/src/backend/lib/bipartite_match.c
+++ b/src/backend/lib/bipartite_match.c
@@ -38,7 +38,7 @@ static bool hk_depth_search(BipartiteMatchState *state, int u);
BipartiteMatchState *
BipartiteMatch(int u_size, int v_size, short **adjacency)
{
- BipartiteMatchState *state = palloc(sizeof(BipartiteMatchState));
+ BipartiteMatchState *state = palloc_object(BipartiteMatchState);
if (u_size < 0 || u_size >= SHRT_MAX ||
v_size < 0 || v_size >= SHRT_MAX)
diff --git a/src/backend/lib/dshash.c b/src/backend/lib/dshash.c
index e1ba367cf17..82f6aa966de 100644
--- a/src/backend/lib/dshash.c
+++ b/src/backend/lib/dshash.c
@@ -211,7 +211,7 @@ dshash_create(dsa_area *area, const dshash_parameters *params, void *arg)
dsa_pointer control;
/* Allocate the backend-local object representing the hash table. */
- hash_table = palloc(sizeof(dshash_table));
+ hash_table = palloc_object(dshash_table);
/* Allocate the control object in shared memory. */
control = dsa_allocate(area, sizeof(dshash_table_control));
@@ -276,7 +276,7 @@ dshash_attach(dsa_area *area, const dshash_parameters *params,
dsa_pointer control;
/* Allocate the backend-local object representing the hash table. */
- hash_table = palloc(sizeof(dshash_table));
+ hash_table = palloc_object(dshash_table);
/* Find the control object in shared memory. */
control = handle;
diff --git a/src/backend/lib/integerset.c b/src/backend/lib/integerset.c
index f4153b0e15a..aca1df2ad5a 100644
--- a/src/backend/lib/integerset.c
+++ b/src/backend/lib/integerset.c
@@ -284,7 +284,7 @@ intset_create(void)
{
IntegerSet *intset;
- intset = (IntegerSet *) palloc(sizeof(IntegerSet));
+ intset = palloc_object(IntegerSet);
intset->context = CurrentMemoryContext;
intset->mem_used = GetMemoryChunkSpace(intset);
diff --git a/src/backend/lib/pairingheap.c b/src/backend/lib/pairingheap.c
index fa8431f7946..3497dc7902a 100644
--- a/src/backend/lib/pairingheap.c
+++ b/src/backend/lib/pairingheap.c
@@ -43,7 +43,7 @@ pairingheap_allocate(pairingheap_comparator compare, void *arg)
{
pairingheap *heap;
- heap = (pairingheap *) palloc(sizeof(pairingheap));
+ heap = palloc_object(pairingheap);
pairingheap_initialize(heap, compare, arg);
return heap;
diff --git a/src/backend/lib/rbtree.c b/src/backend/lib/rbtree.c
index 1f0553f914d..8fe6bfc539a 100644
--- a/src/backend/lib/rbtree.c
+++ b/src/backend/lib/rbtree.c
@@ -106,7 +106,7 @@ rbt_create(Size node_size,
rbt_freefunc freefunc,
void *arg)
{
- RBTree *tree = (RBTree *) palloc(sizeof(RBTree));
+ RBTree *tree = palloc_object(RBTree);
Assert(node_size > sizeof(RBTNode));