summaryrefslogtreecommitdiff
path: root/rts/posix/OSMem.c
Commit message (Collapse)AuthorAgeFilesLines
* Fix warning in OSMem for darwinManuel M T Chakravarty2007-10-301-1/+1
|
* Refactoring: extract platform-specific code from sm/MBlock.cSimon Marlow2007-10-171-1/+196
| | | | Also common-up some duplicate bits in the platform-specific code
* avoid platform dependencies: my_uintptr_t ==> StgWordSimon Marlow2007-09-171-13/+5
|
* replace stgMallocBytesRWX() with our own allocatorSimon Marlow2006-05-301-0/+52
See bug #738 Allocating executable memory is getting more difficult these days. In particular, the default SELinux policy on Fedora Core 5 disallows making the heap (i.e. malloc()'d memory) executable, although it does apparently allow mmap()'ing anonymous executable memory by default. Previously, stgMallocBytesRWX() used malloc() underneath, and then tried to make the page holding the memory executable. This was rather hacky and fails with Fedora Core 5. This patch adds a mini-allocator for executable memory, based on the block allocator. We grab page-sized blocks and make them executable, then allocate small objects from the page. There's a simple free function, that will free whole pages back to the system when they are empty.