- Notifications
You must be signed in to change notification settings - Fork5.3k
Commitfd78544
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 parent1b20c63 commitfd78544
1 file changed
+44
-30
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
79 | 79 | | |
80 | 80 | | |
81 | 81 | | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
82 | 118 | | |
83 | 119 | | |
84 | 120 | | |
| |||
109 | 145 | | |
110 | 146 | | |
111 | 147 | | |
112 | | - | |
| 148 | + | |
113 | 149 | | |
114 | 150 | | |
115 | 151 | | |
116 | | - | |
117 | | - | |
118 | | - | |
119 | 152 | | |
120 | 153 | | |
121 | 154 | | |
122 | 155 | | |
123 | | - | |
124 | | - | |
125 | | - | |
126 | 156 | | |
127 | 157 | | |
128 | 158 | | |
| |||
166 | 196 | | |
167 | 197 | | |
168 | 198 | | |
169 | | - | |
| 199 | + | |
170 | 200 | | |
171 | 201 | | |
172 | 202 | | |
173 | | - | |
174 | | - | |
175 | | - | |
176 | 203 | | |
177 | 204 | | |
178 | 205 | | |
179 | 206 | | |
180 | | - | |
181 | | - | |
182 | | - | |
183 | 207 | | |
184 | 208 | | |
185 | 209 | | |
| |||
202 | 226 | | |
203 | 227 | | |
204 | 228 | | |
205 | | - | |
206 | | - | |
207 | | - | |
| 229 | + | |
208 | 230 | | |
209 | | - | |
210 | | - | |
211 | | - | |
212 | | - | |
| 231 | + | |
| 232 | + | |
213 | 233 | | |
214 | 234 | | |
215 | | - | |
216 | | - | |
217 | | - | |
218 | | - | |
219 | | - | |
220 | | - | |
221 | | - | |
222 | | - | |
223 | | - | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
224 | 238 | | |
225 | 239 | | |
226 | 240 | | |
| |||
0 commit comments
Comments
(0)