Function region::query_range
source · Expand description
Queries the OS with a range, returning the regions it contains.
A 2-byte range straddling a page boundary will return both pages (or one
region, if the pages have the same properties). The implementation uses
query
internally.
- The range is
[address, address + size)
- The address is rounded down to the closest page boundary.
- The address may not be null.
- The size may not be zero.
Examples
let data = [0; 100];
let region = region::query_range(data.as_ptr(), data.len()).unwrap();
assert!(region.len() > 0);