git.postgresql.org Git - postgresql.git/commit

git projects / postgresql.git / commit
? search:
summary | shortlog | log | commit | commitdiff | tree
(parent: 2da8961) | patch
Remove MaxBackends variable in favor of GetMaxBackends() function.
Tue, 8 Feb 2022 20:52:40 +0000 (15:52 -0500)
Tue, 8 Feb 2022 20:53:19 +0000 (15:53 -0500)
commit aa64f23b02924724eafbd9eadbf26d85df30a12b
Remove MaxBackends variable in favor of GetMaxBackends() function.

Previously, it was really easy to write code that accessed MaxBackends
before we'd actually initialized it, especially when coding up an
extension. To make this less error-prune, introduce a new function
GetMaxBackends() which should be used to obtain the correct value.
This will ERROR if called too early. Demote the global variable to
a file-level static, so that nobody can peak at it directly.

Nathan Bossart. Idea by Andres Freund. Review by Greg Sabino Mullane,
by Michael Paquier (who had doubts about the approach), and by me.

Discussion: http://postgr.es/m/20210802224204.bckcikl45uezv5e4@alap3.anarazel.de
19 files changed:
src/backend/access/nbtree/nbtutils.c diff | blob | blame | history
src/backend/access/transam/multixact.c diff | blob | blame | history
src/backend/access/transam/twophase.c diff | blob | blame | history
src/backend/commands/async.c diff | blob | blame | history
src/backend/libpq/pqcomm.c diff | blob | blame | history
src/backend/postmaster/auxprocess.c diff | blob | blame | history
src/backend/postmaster/postmaster.c diff | blob | blame | history
src/backend/storage/ipc/dsm.c diff | blob | blame | history
src/backend/storage/ipc/procarray.c diff | blob | blame | history
src/backend/storage/ipc/procsignal.c diff | blob | blame | history
src/backend/storage/ipc/sinvaladt.c diff | blob | blame | history
src/backend/storage/lmgr/deadlock.c diff | blob | blame | history
src/backend/storage/lmgr/lock.c diff | blob | blame | history
src/backend/storage/lmgr/predicate.c diff | blob | blame | history
src/backend/storage/lmgr/proc.c diff | blob | blame | history
src/backend/utils/activity/backend_status.c diff | blob | blame | history
src/backend/utils/adt/lockfuncs.c diff | blob | blame | history
src/backend/utils/init/postinit.c diff | blob | blame | history
src/include/miscadmin.h diff | blob | blame | history
This is the main PostgreSQL git repository.
RSS Atom

AltStyle によって変換されたページ (->オリジナル) /