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

chore: pull helio and adjust mimalloc for 32MiB segments #3174

Merged
merged 5 commits into from
Jul 2, 2024
Merged
Changes from 1 commit
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
6 changes: 3 additions & 3 deletions src/core/segment_allocator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ constexpr size_t kSegmentShift = MI_SEGMENT_SHIFT;
namespace dfly {

SegmentAllocator::SegmentAllocator(mi_heap_t* heap) : heap_(heap) {
// mimalloc uses 4MiB segments and we might need change this code if it changes.
constexpr size_t kSegLogSpan = 32 - kSegmentIdBits + 3;
// mimalloc uses 32MiB segments and we might need change this code if it changes.
constexpr size_t kSegLogSpan = 32 - kSegmentIdBits + 3 + 3;
static_assert(kSegLogSpan == kSegmentShift);
static_assert((~kSegmentAlignMask) == (MI_SEGMENT_SIZE - 1));
// static_assert((~kSegmentAlignMask) == (MI_SEGMENT_SIZE - 1));
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

99% Sure this was a mistake. When this was introduced it would not pass the assertion on the previous versions.

Also mimalloc uses 32MiB segments but we fetch 4MiB. We can bump this up to 8MiB or 32MiB to give 1-1 mapping.

I am not very familiar with SmallString which uses this extensively so I will update on this.

}

void SegmentAllocator::ValidateMapSize() {
Expand Down
Loading