| 2462 | } |
| 2463 | |
| 2464 | void destroy() { |
| 2465 | if (0 == mMask) { |
| 2466 | // don't deallocate! |
| 2467 | return; |
| 2468 | } |
| 2469 | |
| 2470 | Destroyer<Self, IsFlat && std::is_trivially_destructible<Node>::value>{} |
| 2471 | .nodesDoNotDeallocate(*this); |
| 2472 | |
| 2473 | // This protection against not deleting mMask shouldn't be needed as it's sufficiently |
| 2474 | // protected with the 0==mMask check, but I have this anyways because g++ 7 otherwise |
| 2475 | // reports a compile error: attempt to free a non-heap object 'fm' |
| 2476 | // [-Werror=free-nonheap-object] |
| 2477 | if (mKeyVals != reinterpret_cast_no_cast_align_warning<Node*>(&mMask)) { |
| 2478 | ROBIN_HOOD_LOG("std::free") |
| 2479 | std::free(mKeyVals); |
| 2480 | } |
| 2481 | } |
| 2482 | |
| 2483 | void init() noexcept { |
| 2484 | mKeyVals = reinterpret_cast_no_cast_align_warning<Node*>(&mMask); |
no test coverage detected