On 28 Jun 2008, at 10:56, David Ayers wrote:
Richard Frith-Macdonald schrieb:
Author: rfm
Date: Sat Jun 28 07:13:47 2008
New Revision: 26723
URL: http://svn.gna.org/viewcvs/gnustep?rev=26723&view=rev
Log:
Try to ensure that ffi uses executable memory and doesn't segfault
Ahh! Yes, mmap! Thank you!
I think calling mmap directly is the wrong solution here. You should
be using valloc() with the requested size rounded up to the nearest
page size, and then use mprotect to set it as executable. Note that
most sane operating systems (and Vista) are moving to W^X, so you need
to set it as writeable while creating it, then executable while using
it (i.e. call mprotect immediately before the return).
David
_______________________________________________
Gnustep-dev mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/gnustep-dev