Added btop_platform.cpp, moved btop_linux.cpp to btop_linux.hpp and updated robin_hood.h

This commit is contained in:
aristocratos
2021-08-23 17:35:27 +02:00
parent b2e0707c32
commit 03f64c22de
8 changed files with 78 additions and 55 deletions

View File

@@ -36,7 +36,7 @@
// see https://semver.org/
#define ROBIN_HOOD_VERSION_MAJOR 3 // for incompatible API changes
#define ROBIN_HOOD_VERSION_MINOR 11 // for adding functionality in a backwards-compatible manner
#define ROBIN_HOOD_VERSION_PATCH 2 // for backwards-compatible bug fixes
#define ROBIN_HOOD_VERSION_PATCH 3 // for backwards-compatible bug fixes
#include <algorithm>
#include <cstdlib>
@@ -2427,15 +2427,14 @@ private:
<< (static_cast<double>(mNumElements) * 100.0 /
(static_cast<double>(mMask) + 1)))
nextHashMultiplier();
if (mNumElements * 2 < calcMaxNumElementsAllowed(mMask + 1)) {
// we have to resize, even though there would still be plenty of space left!
// Try to rehash instead. Delete freed memory so we don't steadyily increase mem in case
// we have to rehash a few times
nextHashMultiplier();
rehashPowerOfTwo(mMask + 1, true);
} else {
// Each resize use a different hash so we don't so easily overflow.
// Make sure we only have odd numbers, so that the multiplication is reversible!
// we've reached the capacity of the map, so the hash seems to work nice. Keep using it.
rehashPowerOfTwo((mMask + 1) * 2, false);
}
return true;