pgsql: Further twiddling of nodeHash.c hashtable sizing calculation.

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Further twiddling of nodeHash.c hashtable sizing calculation.
Date: 2015-10-04 19:55:31
Message-ID: E1ZipNb-00051E-I7@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Further twiddling of nodeHash.c hashtable sizing calculation.

On reflection, the submitted patch didn't really work to prevent the
request size from exceeding MaxAllocSize, because of the fact that we'd
happily round nbuckets up to the next power of 2 after we'd limited it to
max_pointers. The simplest way to enforce the limit correctly is to
round max_pointers down to a power of 2 when it isn't one already.

(Note that the constraint to INT_MAX / 2, if it were doing anything useful
at all, is properly applied after that.)

Branch
------
REL9_3_STABLE

Details
-------
http://git.postgresql.org/pg/commitdiff/0867e0ad53598e0f700ecce5f8472da4451eeeb6

Modified Files
--------------
src/backend/executor/nodeHash.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Andres Freund 2015-10-04 20:29:41 pgsql: Fix hstore_plpython test when python3 is used.
Previous Message Tom Lane 2015-10-04 18:17:39 pgsql: Fix possible "invalid memory alloc request size" failure in node