Skip to content

Commit

Permalink
Apply bugfix from Bobby
Browse files Browse the repository at this point in the history
maxCount bit width changed but load wasn't updated.
  • Loading branch information
camelid committed Apr 17, 2024
1 parent e4fd57b commit c463652
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/mini_heap.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ class Flags {
d_assert(svOffset < (kPageSize / kMinObjectSize - 1));
d_assert_msg(sizeClass < 255, "sizeClass: %u", sizeClass);
d_assert(maxCount <= (kPageSize / kMinObjectSize));
d_assert(this->maxCount() == maxCount);
d_assert_msg(this->maxCount() == maxCount, "maxCount() (%u) != maxCount (%u)", this->maxCount(), maxCount);
}

inline uint32_t freelistId() const {
Expand All @@ -79,7 +79,7 @@ class Flags {

inline uint32_t maxCount() const {
// XXX: does this assume little endian?
return (_flags.load(std::memory_order_seq_cst) >> MaxCountShift) & 0x1ff;
return (_flags.load(std::memory_order_seq_cst) >> MaxCountShift) & 0x7ff;
}

inline uint32_t sizeClass() const {
Expand Down

0 comments on commit c463652

Please sign in to comment.