Skip to content

Draft: mmap: Use mremap(2) to resize the mmap on Linux

Will Chandler (ex-GitLab) requested to merge wc/remap-inplace into master

memmap2-rs v0.7.0 adds support for the mremap(2) sycall on Linux via the new remap method. This allows us to expand the memory mapped region in-place, allowing us to skip the process of manually updating all RStrings passed to Ruby to the new address.

This does add the possibility of failure if there is insufficient space at the current address. It is unclear to me how much of an issue this is likely to be in practice.

Note that RemapOptions will default may_move to false, but we set it explicitly anyway to make our intent clear.

This syscall is not available on macOS, so we're still stuck with the old tracking methods there for the time being.

Merge request reports