mirror of
https://github.com/postgres/postgres.git
synced 2025-11-18 02:02:55 +03:00
Add static asserts for MAX_BACKENDS limiting factors
So far the various dependencies were documented in the comment above MAX_BACKENDS, but not checked. Discussion: https://postgr.es/m/CA+COZaBO_s3LfALq=b+HcBHFSOEGiApVjrRacCe4VP9m7CJsNQ@mail.gmail.com
This commit is contained in:
5
src/backend/utils/cache/inval.c
vendored
5
src/backend/utils/cache/inval.c
vendored
@@ -120,6 +120,7 @@
|
||||
#include "catalog/catalog.h"
|
||||
#include "catalog/pg_constraint.h"
|
||||
#include "miscadmin.h"
|
||||
#include "storage/procnumber.h"
|
||||
#include "storage/sinval.h"
|
||||
#include "storage/smgr.h"
|
||||
#include "utils/catcache.h"
|
||||
@@ -1651,6 +1652,10 @@ CacheInvalidateSmgr(RelFileLocatorBackend rlocator)
|
||||
{
|
||||
SharedInvalidationMessage msg;
|
||||
|
||||
/* verify optimization stated above stays valid */
|
||||
StaticAssertStmt(MAX_BACKENDS_BITS <= 23,
|
||||
"MAX_BACKEND_BITS is too big for inval.c");
|
||||
|
||||
msg.sm.id = SHAREDINVALSMGR_ID;
|
||||
msg.sm.backend_hi = rlocator.backend >> 16;
|
||||
msg.sm.backend_lo = rlocator.backend & 0xffff;
|
||||
|
||||
Reference in New Issue
Block a user