Skip to content

Comments

Reapplying the Decay Range and other opts#812

Draft
mjp41 wants to merge 5 commits intomainfrom
decay_range2
Draft

Reapplying the Decay Range and other opts#812
mjp41 wants to merge 5 commits intomainfrom
decay_range2

Conversation

@mjp41
Copy link
Member

@mjp41 mjp41 commented Feb 22, 2026

This reapplies the DecayRange PR to the latest version of snmalloc. It also

  • removes some unrequired initialisation that occurs in a fast path for large allocations. Finally, it adds a LargeObjectCache to improve performance of large allocations.

This is a very draft PR with a lot of reviewing of AI refactorings required.

This might increase footprint considerably, and care is needed to configure who it operates precisely.

Comment on lines +62 to +64
// Touch first and last bytes to ensure pages are faulted in
p[0] = 1;
p[ALLOC_SIZE - 1] = 1;

Choose a reason for hiding this comment

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

If I understand correctly, Windows will only faults in touched pages and not the entire range. I don't know the behavior for other kernels but that's what the documention I can find says https://learn.microsoft.com/en-us/windows/win32/memory/reserving-and-committing-memory "... As an alternative to dynamic allocation, the process can simply commit the entire region instead of only reserving it. Both methods result in the same physical memory usage because committed pages do not consume any physical storage until they are first accessed."

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants