diff options
author | Robert Haas <rhaas@postgresql.org> | 2017-03-27 08:30:19 -0400 |
---|---|---|
committer | Robert Haas <rhaas@postgresql.org> | 2017-03-27 08:32:57 -0400 |
commit | a171f01501e11a2ef65d437ac2397a0050892d88 (patch) | |
tree | bb7a4d3c71717f3e18f318d738d5b3930f8fc877 /src/backend/nodes | |
parent | facde2a98f0b5f7689b4e30a9e7376e926e733b8 (diff) | |
download | postgresql-a171f01501e11a2ef65d437ac2397a0050892d88.tar.gz |
Pass DSA_ALLOC_HUGE when allocating a shared TIDBitmap.
When creating an unshared TIDBitmap, we pass MCXT_ALLOC_HUGE to allow
allocations >1GB, so by analogy we pass DSA_ALLOC_HUGE for a shared
TIDBitmap.
Bug introduced by commit 98e6e89040a0534ca26914c66cae9dd49ef62ad9.
Report by Rafia Sabih, fix by Dilip Kumar, adjusted by me.
Discussion: http://postgr.es/m/CAOGQiiPpSnkuKq+oUK_bvQFg2EPGFPN8RwgxTgBa6HU_kQa3EA@mail.gmail.com
Diffstat (limited to 'src/backend/nodes')
-rw-r--r-- | src/backend/nodes/tidbitmap.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/backend/nodes/tidbitmap.c b/src/backend/nodes/tidbitmap.c index ae7a913c12..eab8f68356 100644 --- a/src/backend/nodes/tidbitmap.c +++ b/src/backend/nodes/tidbitmap.c @@ -1533,9 +1533,11 @@ pagetable_allocate(pagetable_hash *pagetable, Size size) * new memory so that pagetable_free can free the old entry. */ tbm->dsapagetableold = tbm->dsapagetable; - tbm->dsapagetable = dsa_allocate0(tbm->dsa, sizeof(PTEntryArray) + size); - + tbm->dsapagetable = dsa_allocate_extended(tbm->dsa, + sizeof(PTEntryArray) + size, + DSA_ALLOC_HUGE | DSA_ALLOC_ZERO); ptbase = dsa_get_address(tbm->dsa, tbm->dsapagetable); + return ptbase->ptentry; } |