Use guard pages rather than heap checks
|Reported by:||schyler||Owned by:||simonmar|
|Type of failure:||None/Unknown||Test Case:|
|Related Tickets:||Differential Rev(s):|
By mmap'ing memory using MAP_ANONYMOUS (or /dev/zero) as PROT_NONE (Windows has an equivalent functionality with VirtualAlloc), it's possible to create a page that will fault when read or written to. It may be possible to remove the heap checks in the runtime, speeding up allocations, and instead expand the heap when a fault is raised.
This is likely cheaper for large pages full of many small allocations than the cost of the heap checking branch.