pub fn memory<T>(
size: usize,
read: bool,
write: bool,
exec: bool,
shared: bool,
) -> *mut T
Expand description
allocate raw program memory (atleast around the size of the system’s page-size (usually 4096); ie, not small allocations)
use os_core::{memory, release};
let mut mem: *mut u8 = memory(4096, true, true, true);
unsafe {*mem} = 0xAB;
assert_eq!(unsafe {*mem}, 0xAB);
release(mem, 4096);