[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Gnustep-cvs] r26723 - in /libs/base/trunk: ChangeLog Headers/Additi
Re: [Gnustep-cvs] r26723 - in /libs/base/trunk: ChangeLog Headers/Additions/GNUstepBase/config.h.in Source/GSFFIInvocation.m configure configure.ac
Sat, 28 Jun 2008 19:51:03 +0100
On 28 Jun 2008, at 10:56, David Ayers wrote:
Richard Frith-Macdonald schrieb:
Date: Sat Jun 28 07:13:47 2008
New Revision: 26723
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).