Function rustix::mm::mremap_fixed
source · pub unsafe fn mremap_fixed(
old_address: *mut c_void,
old_size: usize,
new_size: usize,
flags: MremapFlags,
new_address: *mut c_void,
) -> Result<*mut c_void>
Expand description
mremap(old_address, old_size, new_size, MREMAP_FIXED | flags)
—Resize,
modify, and/or move a memory mapping to a specific address.
For mremap
without moving to a specific address, see mremap
.
mremap_fixed
.
§Safety
old_address
and new_address
must be aligned to the applicable page
size, the range of memory starting at old_address
and extending for
old_size
bytes, rounded up to the applicable page size, must be valid to
mutate with old_address
’s provenance, and the range of memory starting at
new_address
and extending for new_size
bytes, rounded up to the
applicable page size, must be valid to mutate with new_address
’s
provenance.
There must be no Rust references referring to either of those memory regions.