unsafe fn raw_processbuf_to_rwprocessslice<'a>(
    ptr: *mut u8,
    len: usize,
) -> &'a WriteableProcessSlice
Expand description

Convert an process buffers’s internal representation to a WriteableProcessSlice.

This function will automatically convert zero-length process buffers into valid zero-sized Rust slices regardless of the value of ptr.

§Safety requirements

In the case of len != 0, the memory [ptr; ptr + len) must be within a single process’ address space, and ptr must be nonzero. This memory region must be mapped as readable and writable, and optionally executable. It must be allocated within a single process’ address space for the entire lifetime 'a.

No other mutable or immutable Rust reference pointing to an overlapping memory region, which is not also created over UnsafeCell, may exist over the entire lifetime 'a. Even though this effectively returns a slice of Cells, writing to some memory through a Cell while another reference is in scope is unsound. Because a process is free to modify its memory, this is – in a broader sense – true for all process memory.

However, it is sound for multiple overlapping ReadableProcessSlices or WriteableProcessSlices to be in scope at the same time.