forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitb2b023a
committed
injection_points: Add initialization of shmem state when loading module
This commits adds callbacks to initialize the shared memory state of themodule when loaded with shared_preload_libraries. This is necessary tobe able to update the test introduced in768a9fd to use the macrosINJECTION_POINT_{LOAD,CACHED}() rather than a SQL function in the moduleinjection_points forcing a load, as this test runs a callback in acritical section where no memory allocation should happen.Initializing the shared memory state of the module while loadingprovides a strict control on the timing of its allocation. If themodule is not loaded at startup, it will use a GetNamedDSMSegment()instead to initialize its shmem state on-the-fly.Per discussion with Álvaro Herrera.Author: Michael PaquierDiscussion:https://postgr.es/m/ZsUnJUlSOBNAzwW1@paquier.xyz1 parentedcb712 commitb2b023a
1 file changed
+59
-3
lines changedLines changed: 59 additions & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
68 | 68 |
| |
69 | 69 |
| |
70 | 70 |
| |
71 |
| - | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
72 | 77 |
| |
73 | 78 |
| |
74 | 79 |
| |
| |||
97 | 102 |
| |
98 | 103 |
| |
99 | 104 |
| |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
100 | 109 |
| |
101 |
| - | |
| 110 | + | |
| 111 | + | |
102 | 112 |
| |
103 | 113 |
| |
104 | 114 |
| |
| |||
111 | 121 |
| |
112 | 122 |
| |
113 | 123 |
| |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
114 | 164 |
| |
115 |
| - | |
| 165 | + | |
116 | 166 |
| |
117 | 167 |
| |
118 | 168 |
| |
| |||
463 | 513 |
| |
464 | 514 |
| |
465 | 515 |
| |
| 516 | + | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
466 | 522 |
| |
467 | 523 |
| |
468 | 524 |
|
0 commit comments
Comments
(0)