Compile fixes, integration of fast PRNG.

This commit is contained in:
Adam Ierymenko 2013-07-13 14:28:26 -04:00
parent 3e49337d9a
commit 97cbd98bc5
11 changed files with 154 additions and 66 deletions

View file

@ -234,7 +234,7 @@ public:
// network graph likely to be hops away from the original origin of the
// message.
for(unsigned int i=0;i<ZT_MULTICAST_BLOOM_FILTER_DECAY_RATE;++i)
bf.decay();
bf.decay((unsigned int)prng.next32());
{
Mutex::Lock _l(_multicastMemberships_m);
@ -261,8 +261,7 @@ public:
// Skip some fraction of entries so that our sampling will be randomly distributed,
// since there is no other good way to sample randomly from a map.
if (numEntriesPermittedToSkip) {
double skipThis = (double)(Utils::randomInt<uint32_t>()) / 4294967296.0;
if (skipThis <= skipWhatFraction) {
if (prng.nextDouble() <= skipWhatFraction) {
--numEntriesPermittedToSkip;
++channelMemberEntry;
continue;