Conversation
| // Touch first and last bytes to ensure pages are faulted in | ||
| p[0] = 1; | ||
| p[ALLOC_SIZE - 1] = 1; |
There was a problem hiding this comment.
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."
There was a problem hiding this comment.
Yeah the benchmark is not going to fault all the pages in. Just the first and last, and this would be true of most platforms. If this lands, I'll fix. Thanks
717e506 to
f3dc069
Compare
|
I think this is ready to review. But we should address #814 before we commit this, as it may either hide or worsen this behaviour. |
Add a backend range that delays returning memory to the next level. This reduces the pressure on the backend global allocator.
This reapplies the DecayRange PR to the latest version of snmalloc. It also
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.