Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add C++17 version for Mac. #635

Merged
merged 4 commits into from
Sep 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
4 changes: 2 additions & 2 deletions src/snmalloc/backend_helpers/buddy.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down