codegen: explicit allocate codebuffer with proper permissions
authorBernhard Urban <lewurm@gmail.com>
Mon, 30 Apr 2012 08:16:37 +0000 (10:16 +0200)
committerBernhard Urban <lewurm@gmail.com>
Mon, 30 Apr 2012 08:16:37 +0000 (10:16 +0200)
commit5630bf33a46d9bf47e07909bc62a785440f1acf7
tree1f8642426daa1c5a165ff7464decccf505c67f8d
parent5ace595439b1cd360bade19293b2a69a7fd9910f
codegen: explicit allocate codebuffer with proper permissions

we had weird issues, when upgrading ghc:
http://stackoverflow.com/questions/10341943/ghc-segmentation-fault-under-strange-conditions

therefore, this fix: use `mprotect' to set the codebuffer explicitly executable.
`mprotect' requires aligned memory, so we use `memalign'.
Harpy/CodeGenMonad.hs