Tweak dynahash.c to avoid wasting memory space in non-shared hash tables.
authorTom Lane <tgl@sss.pgh.pa.us>
Sun, 25 Jun 2006 18:29:56 +0000 (18:29 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Sun, 25 Jun 2006 18:29:56 +0000 (18:29 +0000)
commite057c24d0339d67af71a1c23ce1c06b8c1e765e6
tree05dcff6031726624e25137901ea5a58ccba52949
parent6445eef4cabe3a372e69239b9e8df77ff360bf75
Tweak dynahash.c to avoid wasting memory space in non-shared hash tables.
palloc() will normally round allocation requests up to the next power of 2,
so make dynahash choose allocation sizes that are as close to a power of 2
as possible.
Back-patch to 8.1 --- the problem exists further back, but a much larger
patch would be needed and it doesn't seem worth taking any risks.
src/backend/utils/hash/dynahash.c
src/include/utils/hsearch.h