
On Fri, Jan 9, 2009 at 19:11, Michael Marcin <mike.marcin@gmail.com> wrote:
How expensive is it in terms of memory to store a static or thread local uuid_generator for the length of the program? I only expect this to be called maybe twice. The application will run on memory constrained mobile devices.
The random-based generator is essentially just a wrapper on the (P)RNG, so it'll take as much storage as the PRNG. (v13 stores the variate generator too, but I think that'll change, since afaik that's cheap to construct.) There's a nice table with memory requirements here: http://www.boost.org/doc/libs/1_37_0/libs/random/random-generators.html#intr... So while the default PRNG needs 625*sizeof(uint32_t) of state, you could use a basic_uuid_generator<rand48>, which will need only 64 bits of storage. (Plus apparently at least 64 bits for the generator, but you can get rid of that easily enough by changing the uuid generator to construct it on demand.) ~ Scott