forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitc941aed
committed
When using the OSSP UUID library, cache its uuid_t state object.
The original coding in contrib/uuid-ossp created and destroyed a uuid_tobject (or, in some cases, even two of them) each time it was called.This is not the intended usage: you're supposed to keep the uuid_t objectaround so that the library can cache its state across uses. (Other UUIDlibraries seem to keep equivalent state behind-the-scenes in staticvariables, but OSSP chose differently.) Aside from being quite inefficient,creating a new uuid_t loses knowledge of the previously generated UUID,which in theory could result in duplicate V1-style UUIDs being createdon sufficiently fast machines.On at least some platforms, creating a new uuid_t also draws some entropyfrom /dev/urandom, leaving less for the rest of the system. This seemssufficiently unpleasant to justify back-patching this change.1 parent25dd07e commitc941aed
1 file changed
+45
-31
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
141 | 141 | | |
142 | 142 | | |
143 | 143 | | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
144 | 180 | | |
145 | 181 | | |
146 | 182 | | |
| |||
171 | 207 | | |
172 | 208 | | |
173 | 209 | | |
174 | | - | |
| 210 | + | |
175 | 211 | | |
176 | 212 | | |
177 | 213 | | |
178 | | - | |
179 | | - | |
180 | | - | |
181 | 214 | | |
182 | 215 | | |
183 | 216 | | |
184 | 217 | | |
185 | | - | |
186 | | - | |
187 | | - | |
188 | 218 | | |
189 | 219 | | |
190 | 220 | | |
| |||
193 | 223 | | |
194 | 224 | | |
195 | 225 | | |
196 | | - | |
| 226 | + | |
197 | 227 | | |
198 | 228 | | |
199 | 229 | | |
200 | | - | |
201 | | - | |
202 | | - | |
203 | 230 | | |
204 | 231 | | |
205 | 232 | | |
206 | 233 | | |
207 | | - | |
208 | | - | |
209 | | - | |
210 | 234 | | |
211 | 235 | | |
212 | 236 | | |
| |||
215 | 239 | | |
216 | 240 | | |
217 | 241 | | |
218 | | - | |
219 | | - | |
220 | | - | |
| 242 | + | |
221 | 243 | | |
222 | | - | |
223 | | - | |
224 | | - | |
225 | | - | |
| 244 | + | |
| 245 | + | |
226 | 246 | | |
227 | 247 | | |
228 | | - | |
229 | | - | |
230 | | - | |
231 | | - | |
232 | | - | |
233 | | - | |
234 | | - | |
235 | | - | |
236 | | - | |
237 | | - | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
238 | 252 | | |
239 | 253 | | |
240 | 254 | | |
| |||
0 commit comments
Comments
(0)