
#8703: Use guard pages rather than heap checks -------------------------------------+------------------------------------ Reporter: schyler | Owner: simonmar Type: feature request | Status: closed Priority: normal | Milestone: Component: Runtime System | Version: Resolution: wontfix | Keywords: Operating System: Unknown/Multiple | Architecture: Unknown/Multiple Type of failure: None/Unknown | Difficulty: Unknown Test Case: | Blocked By: Blocking: | Related Tickets: -------------------------------------+------------------------------------ Changes (by simonmar): * status: new => closed * resolution: => wontfix Comment: This is a lot harder to do than you might imagine - the problem is not the memory protection itself, but how to handle the fault when the invalid page is accessed. This requires all kinds of platform-specific hackery. GHC's heap is constructed of linked lists of pages, so at the end of each page we have to swing the heap pointer to the next page in the list, which is often not contiguous with the previous page. Using the page fault trick is even harder when the memory must grow through non-contiguous pages, because the fault handler has to also update the current heap pointer. I'm not saying it can't be done, but it is (a) very tricky, (b) non- portable, and (c) after you've surmounted all the obstacles, it probably doesn't save that much time, if any. And because it's non-portable, you still have to keep the old way of doing things. I'm closing the ticket. But if you want to implement this and demonstrate that it is indeed a win, be my guest! -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8703#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler