Skip to content

Commit

Permalink
Buddy range: assert that MAX > MIN
Browse files Browse the repository at this point in the history
This assert is presently false, leading to several 0-sized arrays that then
cause gcc's -Warray-bounds to trip.
  • Loading branch information
nwf-msr committed Sep 4, 2024
1 parent fcad154 commit b7c38ec
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/snmalloc/backend_helpers/buddy.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ namespace snmalloc
template<typename Rep, size_t MIN_SIZE_BITS, size_t MAX_SIZE_BITS>
class Buddy
{
static_assert(MAX_SIZE_BITS > MIN_SIZE_BITS);

struct Entry
{
typename Rep::Contents cache[3];
Expand Down

0 comments on commit b7c38ec

Please sign in to comment.