This PR implements Mmap::into_raw() to turn an existing memory mapping object into a raw pointer and the size of the memory mapping. After calling this function the user is responsible for the memory previously managed by the memory mapping object.
In addition, this PR implements Mmap::from_raw() to create a memory mapping object from a raw pointer and a size. This is unsafe since the user can call this function more than once for the same raw pointer, which would result in a double-free. Furthermore, the current implementation does not check whether the memory mapping has the appropriate permissions, or whether it even exists.
This PR implements
Mmap::into_raw()
to turn an existing memory mapping object into a raw pointer and the size of the memory mapping. After calling this function the user is responsible for the memory previously managed by the memory mapping object.In addition, this PR implements
Mmap::from_raw()
to create a memory mapping object from a raw pointer and a size. This is unsafe since the user can call this function more than once for the same raw pointer, which would result in a double-free. Furthermore, the current implementation does not check whether the memory mapping has the appropriate permissions, or whether it even exists.