forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit05f9084
committed
Various cleanups of the new memory context header code
Robert Haas reported that his older clang compiler didn't like the twoAsserts which were verifying that the given MemoryContextMethodID was <=MEMORY_CONTEXT_METHODID_MASK when building with-Wtautological-constant-out-of-range-compare. In my (David's) opinion,the compiler is wrong to warn about that. Newer versions of clang don'twarn about the out of range enum value, so perhaps this was a bug that hasnow been fixed. To keep older clang versions happy, let's just cast theenum value to int to stop the compiler complaining.The main reason for the Asserts mentioned above to exist are to informfuture developers which are adding new MemoryContexts if they run out ofbit space in MemoryChunk to store the MemoryContextMethodID. As pointedout by Tom Lane, it seems wise to also add a comment to the header forthat enum to document the restriction on these enum values.Additionally, also fix an incorrect usage of UINT64CONST() which wasintroduced inc6e0fe1.Author: Robert Haas, David RowleyDiscussion:https://postgr.es/m/CA+TgmoYGG2C7Vbw1cjkQRRBL3zOk8SmhrQnsJgzscX=N9AwPrw@mail.gmail.com1 parent5495796 commit05f9084
2 files changed
+6
-3
lines changedLines changed: 4 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
74 | 74 |
| |
75 | 75 |
| |
76 | 76 |
| |
| 77 | + | |
| 78 | + | |
| 79 | + | |
77 | 80 |
| |
78 | 81 |
| |
79 | 82 |
| |
| |||
88 | 91 |
| |
89 | 92 |
| |
90 | 93 |
| |
91 |
| - | |
| 94 | + | |
92 | 95 |
| |
93 | 96 |
| |
94 | 97 |
| |
|
Lines changed: 2 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
159 | 159 |
| |
160 | 160 |
| |
161 | 161 |
| |
162 |
| - | |
| 162 | + | |
163 | 163 |
| |
164 | 164 |
| |
165 | 165 |
| |
| |||
175 | 175 |
| |
176 | 176 |
| |
177 | 177 |
| |
178 |
| - | |
| 178 | + | |
179 | 179 |
| |
180 | 180 |
| |
181 | 181 |
| |
|
0 commit comments
Comments
(0)