interprocess icon indicating copy to clipboard operation
interprocess copied to clipboard

Add support for growing `mapped_region`

Open Lastique opened this issue 9 months ago • 0 comments

Linux, NetBSD and Solaris have a mremap system call that allows to opportunistically grow or relocate the existing memory mapping. There also seems to be a way to achieve this on Windows, but I'm not familiar with that API.

Please, add support for this functionality (specifically, growing and/or relocating a memory mapping) to the mapped_region class. For example, add a grow_by method that would try to increase the size of the mapped region at the same address and remap to relocate the region at a different address and size. On platforms that don't support this functionality, the new methods would always fail. This would also be indicated at compile time by some library-defined config macro.

Lastique avatar Mar 10 '25 00:03 Lastique