Tweak dynahash.c to avoid wasting memory space in non-shared hash tables.

Tom Lane <tgl@sss.pgh.pa.us>

Commit: 1f9acaf21d35796b962446a69d12f87e0e673668
Author: Tom Lane <tgl@sss.pgh.pa.us>
Date: 2006-06-25T18:29:56Z
Releases: 8.1.5
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.

Files

PathChange+/−
src/backend/utils/hash/dynahash.c modified +43 −8
src/include/utils/hsearch.h modified +1 −3