fleur icon indicating copy to clipboard operation
fleur copied to clipboard

Heap allocation weirdnesses

Open gallypette opened this issue 3 years ago • 0 comments

  • allocate only once,
  • no static

The usage of static variables makes the BloomFilter code unnecessarily dangerous to use when multiple threads are used even if every thread just wants to allocate and use totally separate bloom filters. Actually it could even cause issues with two bloom filters created after each other since even Initialize just returns a pointer to a single static BloomFilter :o I can't come up with a reason why you'd consider making anything in there static.

gallypette avatar Jul 28 '22 06:07 gallypette