forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitcd3ccf8
committed
Base LWLock limits directly on MAX_BACKENDS
Jacob reported that comments for LW_SHARED_MASK referenced a MAX_BACKENDSlimit of 2^23-1, but that MAX_BACKENDS is actually limited to 2^18-1. Thelimit was lowered in4835458, but the comment in lwlock.c wasn't updated.Instead of just fixing the comment, it seems better to directly base thelwlock defines on MAX_BACKENDS and add static assertions to ensure that thereis enough space. That way there's no comment that can go out of sync in thefuture.As part of that change I noticed that for some reason the high bit wasn't usedfor flags, which seems somewhat odd. Redefine the flag values to start at thehighest bit.Reported-by: Jacob Brazeal <jacob.brazeal@gmail.com>Reviewed-by: Jacob Brazeal <jacob.brazeal@gmail.com>Discussion:https://postgr.es/m/CA+COZaBO_s3LfALq=b+HcBHFSOEGiApVjrRacCe4VP9m7CJsNQ@mail.gmail.com1 parent6394a3a commitcd3ccf8
1 file changed
+20
-10
lines changedLines changed: 20 additions & 10 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
91 | 91 |
| |
92 | 92 |
| |
93 | 93 |
| |
94 |
| - | |
95 |
| - | |
96 |
| - | |
97 |
| - | |
98 |
| - | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
99 | 102 |
| |
100 | 103 |
| |
101 |
| - | |
102 |
| - | |
103 |
| - | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
104 | 114 |
| |
105 |
| - | |
106 |
| - | |
| 115 | + | |
| 116 | + | |
107 | 117 |
| |
108 | 118 |
| |
109 | 119 |
| |
|
0 commit comments
Comments
(0)