Add C++17 version for Mac. (#635)

This commit is contained in:
Matthew Parkinson
2023-09-18 09:37:56 +01:00
committed by GitHub
parent 6b8f3338c7
commit 2a7670eb82
2 changed files with 6 additions and 2 deletions

View File

@@ -44,6 +44,10 @@ jobs:
dependencies: "rm -f /usr/local/bin/2to3 ; brew update && brew install ninja"
- os: "macos-12"
dependencies: "rm -f /usr/local/bin/2to3 ; brew update && brew install ninja"
- os: "macos-12"
variant: "C++17"
dependencies: "rm -f /usr/local/bin/2to3 ; brew update && brew install ninja"
cmake-flags: "-DSNMALLOC_USE_CXX17=ON"
# Add the self-host build, using the bounds-checked memcpy in
# maximally paranoid mode (checking loads and stores)
- os: "ubuntu-latest"

View File

@@ -15,9 +15,9 @@ namespace snmalloc
template<typename Rep, size_t MIN_SIZE_BITS, size_t MAX_SIZE_BITS>
class Buddy
{
std::array<RBTree<Rep>, MAX_SIZE_BITS - MIN_SIZE_BITS> trees;
std::array<RBTree<Rep>, MAX_SIZE_BITS - MIN_SIZE_BITS> trees{};
// All RBtrees at or above this index should be empty.
size_t empty_at_or_above = 0;
size_t empty_at_or_above{0};
size_t to_index(size_t size)
{