forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit528c454
committed
Don't #include utils/palloc.h in common/fe_memutils.h.
This breaks the principle that common/ ought not depend on anything in theserver, not only code-wise but in the headers. The only arguable advantageis avoidance of duplication of half a dozen extern declarations, and eventhat is rather dubious, considering that the previous coding was wrongabout which declarations to duplicate: it exposed pnstrdup() to frontendcode even though no such function is provided in fe_memutils.c.On the same principle, don't #include utils/memutils.h in the frontendbuild of psprintf.c. This requires duplicating the definition ofMaxAllocSize, but that seems fine to me: there's no a-priori reason whyfrontend code should use the same size limit as the backend anyway.In passing, clean up some rather odd layout and ordering choices thatwere imposed on palloc.h to reduce the number of #ifdefs required bythe previous approach.Per gripe from Christoph Berg. There's still more work to do to makeinclude/common/ clean, but this part seems reasonably noncontroversial.1 parent39b0c76 commit528c454
File tree
3 files changed
+32
-18
lines changed- src
- common
- include
- common
- utils
3 files changed
+32
-18
lines changedLines changed: 9 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
15 | 15 |
| |
16 | 16 |
| |
17 | 17 |
| |
| 18 | + | |
18 | 19 |
| |
| 20 | + | |
| 21 | + | |
| 22 | + | |
19 | 23 |
| |
| 24 | + | |
20 | 25 |
| |
21 |
| - | |
22 | 26 |
| |
23 |
| - | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
24 | 31 |
| |
25 | 32 |
| |
26 | 33 |
| |
|
Lines changed: 13 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
9 | 9 |
| |
10 | 10 |
| |
11 | 11 |
| |
| 12 | + | |
12 | 13 |
| |
13 | 14 |
| |
14 | 15 |
| |
15 | 16 |
| |
16 | 17 |
| |
17 | 18 |
| |
18 |
| - | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
19 | 31 |
| |
20 | 32 |
|
Lines changed: 10 additions & 15 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
35 | 35 |
| |
36 | 36 |
| |
37 | 37 |
| |
38 |
| - | |
39 |
| - | |
40 | 38 |
| |
41 | 39 |
| |
42 |
| - | |
43 |
| - | |
| 40 | + | |
| 41 | + | |
44 | 42 |
| |
45 | 43 |
| |
46 | 44 |
| |
| |||
51 | 49 |
| |
52 | 50 |
| |
53 | 51 |
| |
54 |
| - | |
55 |
| - | |
56 |
| - | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
57 | 56 |
| |
58 | 57 |
| |
59 | 58 |
| |
| |||
68 | 67 |
| |
69 | 68 |
| |
70 | 69 |
| |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
71 | 74 |
| |
72 | 75 |
| |
73 | 76 |
| |
| |||
93 | 96 |
| |
94 | 97 |
| |
95 | 98 |
| |
96 |
| - | |
97 |
| - | |
98 | 99 |
| |
99 | 100 |
| |
100 | 101 |
| |
101 |
| - | |
102 |
| - | |
103 |
| - | |
104 |
| - | |
105 |
| - | |
106 |
| - | |
107 | 102 |
| |
108 | 103 |
| |
109 | 104 |
| |
|
0 commit comments
Comments
(0)