mirror of
https://github.com/postgres/postgres.git
synced 2025-10-29 22:49:41 +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:
@@ -30,6 +30,7 @@
|
||||
#include "pgstat.h"
|
||||
#include "storage/lmgr.h"
|
||||
#include "storage/proc.h"
|
||||
#include "storage/procnumber.h"
|
||||
#include "utils/memutils.h"
|
||||
|
||||
|
||||
@@ -191,6 +192,8 @@ InitDeadLockChecking(void)
|
||||
* last MaxBackends entries in possibleConstraints[] are reserved as
|
||||
* output workspace for FindLockCycle.
|
||||
*/
|
||||
StaticAssertStmt(MAX_BACKENDS_BITS <= (32 - 3),
|
||||
"MAX_BACKENDS_BITS too big for * 4");
|
||||
maxPossibleConstraints = MaxBackends * 4;
|
||||
possibleConstraints =
|
||||
(EDGE *) palloc(maxPossibleConstraints * sizeof(EDGE));
|
||||
|
||||
Reference in New Issue
Block a user