aboutsummaryrefslogtreecommitdiff
path: root/src/backend/utils/adt/jsonfuncs.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2014-05-29 13:51:02 -0400
committerTom Lane <tgl@sss.pgh.pa.us>2014-05-29 13:51:02 -0400
commitc941aed96b482e32dc3a8eba66b298824e7adc39 (patch)
treef654658db1049fce52f1dbdf6a14912fe2ce5ec4 /src/backend/utils/adt/jsonfuncs.c
parent25dd07e0f6ba1aef0a6802474112b5bcce621ea4 (diff)
downloadpostgresql-c941aed96b482e32dc3a8eba66b298824e7adc39.tar.gz
postgresql-c941aed96b482e32dc3a8eba66b298824e7adc39.zip
When using the OSSP UUID library, cache its uuid_t state object.
The original coding in contrib/uuid-ossp created and destroyed a uuid_t object (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 object around so that the library can cache its state across uses. (Other UUID libraries seem to keep equivalent state behind-the-scenes in static variables, 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 created on sufficiently fast machines. On at least some platforms, creating a new uuid_t also draws some entropy from /dev/urandom, leaving less for the rest of the system. This seems sufficiently unpleasant to justify back-patching this change.
Diffstat (limited to 'src/backend/utils/adt/jsonfuncs.c')
0 files changed, 0 insertions, 0 deletions