diff options
author | Simon Marlow <simonmar@microsoft.com> | 2006-05-30 10:02:11 +0000 |
---|---|---|
committer | Simon Marlow <simonmar@microsoft.com> | 2006-05-30 10:02:11 +0000 |
commit | e3c55aebd4f9ce7a5b4390d4726612865fd207f2 (patch) | |
tree | 87a1e86bc77f2c1d8d4dba8757e14fce324fe736 /rts/RtsUtils.h | |
parent | 6b36d8ad3bfd1890583f3bcab96559f05bff332b (diff) | |
download | haskell-e3c55aebd4f9ce7a5b4390d4726612865fd207f2.tar.gz |
replace stgMallocBytesRWX() with our own allocator
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.
Diffstat (limited to 'rts/RtsUtils.h')
-rw-r--r-- | rts/RtsUtils.h | 3 |
1 files changed, 0 insertions, 3 deletions
diff --git a/rts/RtsUtils.h b/rts/RtsUtils.h index 96a5f0d82f..93139367b3 100644 --- a/rts/RtsUtils.h +++ b/rts/RtsUtils.h @@ -16,9 +16,6 @@ extern void *stgMallocBytes(int n, char *msg) GNUC3_ATTRIBUTE(__malloc__); -extern void* stgMallocBytesRWX(int len) - GNUC3_ATTRIBUTE(__malloc__); - extern void *stgReallocBytes(void *p, int n, char *msg); extern void *stgCallocBytes(int n, int m, char *msg) |