summaryrefslogtreecommitdiffstatsabout
diff options
context:
space:
mode:
authorJiaojinxing <jiaojinxing1987@gmail.com>2018-03-20 05:47:59 (GMT)
committer Jiaojinxing <jiaojinxing1987@gmail.com>2018-03-20 05:47:59 (GMT)
commite9b0f673f4e02ee496f6fd547af8c63efbb88a1a (patch)
tree2dd7c02f92b8571f8f1960b1b7b074c0de143c88
parentf5d2ea09aca7b1265f696bb5313283a3ea6e76b2 (diff)
downloadlibffi-e9b0f673f4e02ee496f6fd547af8c63efbb88a1a.zip
libffi-e9b0f673f4e02ee496f6fd547af8c63efbb88a1a.tar.gz
libffi-e9b0f673f4e02ee496f6fd547af8c63efbb88a1a.tar.bz2
Updated memory heap algorithm to dlmalloc.
-rw-r--r--libffi/src/closures.c21
1 files changed, 1 insertions, 20 deletions
diff --git a/libffi/src/closures.c b/libffi/src/closures.c
index f1bd897..6e89217 100644
--- a/libffi/src/closures.c
+++ b/libffi/src/closures.c
@@ -26,8 +26,6 @@
DEALINGS IN THE SOFTWARE.
----------------------------------------------------------------------- */
-#define __SYLIXOS_KERNEL
-
#if defined __linux__ && !defined _GNU_SOURCE
#define _GNU_SOURCE 1
#endif
@@ -47,7 +45,7 @@
# define FFI_MMAP_EXEC_WRIT 1
# define HAVE_MNTENT 1
# endif
-# if defined(X86_WIN32) || defined(X86_WIN64) || defined(__OS2__)
+# if defined(X86_WIN32) || defined(X86_WIN64) || defined(__OS2__) || defined(SYLIXOS)
/* Windows systems may have Data Execution Protection (DEP) enabled,
which requires the use of VirtualMalloc/VirtualFree to alloc/free
executable memory. */
@@ -671,7 +669,6 @@ int main ()
#include <stdlib.h>
-#ifndef SYLIXOS
void *
ffi_closure_alloc (size_t size, void **code)
{
@@ -686,22 +683,6 @@ ffi_closure_free (void *ptr)
{
free (ptr);
}
-#else
-void *
-ffi_closure_alloc (size_t size, void **code)
-{
- if (!code)
- return NULL;
-
- return *code = API_VmmMallocEx(size, LW_VMM_FLAG_EXEC | LW_VMM_FLAG_RDWR);
-}
-
-void
-ffi_closure_free (void *ptr)
-{
- API_VmmFree (ptr);
-}
-#endif
# endif /* ! FFI_MMAP_EXEC_WRIT */
#endif /* FFI_CLOSURES */