From 2a7670eb8225e1c96ce91f03cbc0cc17e3aeb6e4 Mon Sep 17 00:00:00 2001 From: Matthew Parkinson Date: Mon, 18 Sep 2023 09:37:56 +0100 Subject: [PATCH] Add C++17 version for Mac. (#635) --- .github/workflows/main.yml | 4 ++++ src/snmalloc/backend_helpers/buddy.h | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index be96704..4855549 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -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" diff --git a/src/snmalloc/backend_helpers/buddy.h b/src/snmalloc/backend_helpers/buddy.h index ff94166..d7cfd17 100644 --- a/src/snmalloc/backend_helpers/buddy.h +++ b/src/snmalloc/backend_helpers/buddy.h @@ -15,9 +15,9 @@ namespace snmalloc template class Buddy { - std::array, MAX_SIZE_BITS - MIN_SIZE_BITS> trees; + std::array, 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) {