aboutsummaryrefslogtreecommitdiff
path: root/src/backend/utils/cache/inval.c
diff options
context:
space:
mode:
authorAndres Freund <andres@anarazel.de>2025-02-24 05:39:27 -0500
committerAndres Freund <andres@anarazel.de>2025-02-24 06:23:41 -0500
commit5ee75e32fa734e8ae85ff096f1523be8e16e1b8d (patch)
tree658cb18707e7dfa01c98ab14630e0d9ba9838626 /src/backend/utils/cache/inval.c
parent418451bfe161e4b86c29f098e4d93b2347d35774 (diff)
downloadpostgresql-5ee75e32fa734e8ae85ff096f1523be8e16e1b8d.tar.gz
postgresql-5ee75e32fa734e8ae85ff096f1523be8e16e1b8d.zip
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
Diffstat (limited to 'src/backend/utils/cache/inval.c')
-rw-r--r--src/backend/utils/cache/inval.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/backend/utils/cache/inval.c b/src/backend/utils/cache/inval.c
index 6aff1ec01d7..700ccb6df9b 100644
--- a/src/backend/utils/cache/inval.c
+++ b/src/backend/utils/cache/inval.c
@@ -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;