Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Shayne Fletcher
Glasgow Haskell Compiler
Commits
be44e76b
Commit
be44e76b
authored
Mar 23, 2006
by
wolfgang.thaller@gmx.net
Browse files
Deal with non-executable memory on Darwin (only an issue on Darwin/x86 so far)
parent
742aea2b
Changes
1
Hide whitespace changes
Inline
Side-by-side
ghc/rts/RtsUtils.c
View file @
be44e76b
...
...
@@ -40,7 +40,7 @@
#include
<pthread.h>
#endif
#if defined(openbsd_HOST_OS) || defined(linux_HOST_OS)
#if defined(openbsd_HOST_OS) || defined(linux_HOST_OS)
|| defined(darwin_HOST_OS)
#include
<unistd.h>
#include
<sys/types.h>
#include
<sys/mman.h>
...
...
@@ -352,7 +352,7 @@ stgMallocBytesRWX(int len)
barf
(
"mallocBytesRWX: failed to protect 0x%p; error=%lu; old protection: %lu
\n
"
,
addr
,
(
unsigned
long
)
GetLastError
(),
(
unsigned
long
)
dwOldProtect
);
}
#elif defined(openbsd_HOST_OS) || defined(linux_HOST_OS)
#elif defined(openbsd_HOST_OS) || defined(linux_HOST_OS)
|| defined(darwin_HOST_OS)
/* malloced memory isn't executable by default on OpenBSD */
my_uintptr_t
pageSize
=
sysconf
(
_SC_PAGESIZE
);
my_uintptr_t
mask
=
~
(
pageSize
-
1
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment