postgresql/contrib/bloom
Tom Lane ea268cdc9a Add macros to make AllocSetContextCreate() calls simpler and safer.
I found that half a dozen (nearly 5%) of our AllocSetContextCreate calls
had typos in the context-sizing parameters.  While none of these led to
especially significant problems, they did create minor inefficiencies,
and it's now clear that expecting people to copy-and-paste those calls
accurately is not a great idea.  Let's reduce the risk of future errors
by introducing single macros that encapsulate the common use-cases.
Three such macros are enough to cover all but two special-purpose contexts;
those two calls can be left as-is, I think.

While this patch doesn't in itself improve matters for third-party
extensions, it doesn't break anything for them either, and they can
gradually adopt the simplified notation over time.

In passing, change TopMemoryContext to use the default allocation
parameters.  Formerly it could only be extended 8K at a time.  That was
probably reasonable when this code was written; but nowadays we create
many more contexts than we did then, so that it's not unusual to have a
couple hundred K in TopMemoryContext, even without considering various
dubious code that sticks other things there.  There seems no good reason
not to let it use growing blocks like most other contexts.

Back-patch to 9.6, mostly because that's still close enough to HEAD that
it's easy to do so, and keeping the branches in sync can be expected to
avoid some future back-patching pain.  The bugs fixed by these changes
don't seem to be significant enough to justify fixing them further back.

Discussion: <21072.1472321324@sss.pgh.pa.us>
2016-08-27 17:50:38 -04:00
..
expected Fix contrib/bloom to work for unlogged indexes. 2016-05-24 21:04:35 -04:00
sql Fix contrib/bloom to work for unlogged indexes. 2016-05-24 21:04:35 -04:00
t Finish pgindent run for 9.6: Perl files. 2016-06-12 04:19:56 -04:00
.gitignore
blcost.c
blinsert.c Add macros to make AllocSetContextCreate() calls simpler and safer. 2016-08-27 17:50:38 -04:00
bloom--1.0.sql Minor fixes in contrib installation scripts. 2016-06-14 10:47:06 -04:00
bloom.control
bloom.h pgindent run for 9.6 2016-06-09 18:02:36 -04:00
blscan.c Fix assorted bugs in contrib/bloom. 2016-08-13 22:24:48 -04:00
blutils.c Fix assorted bugs in contrib/bloom. 2016-08-13 22:24:48 -04:00
blvacuum.c Fix assorted bugs in contrib/bloom. 2016-08-13 22:24:48 -04:00
blvalidate.c
Makefile