Skip to contentSkip to conversation

Use mmap() within code_gen_alloc() for OpenBSD.

PATCH Applied Brad 2 participants 3 messages Dec 21, 2010

lore
Share & tools
lore

Brad

author
#0 lore raw

PATCH 3/3 Use mmap() within code_gen_alloc() for OpenBSD.

---
 exec.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
exec.c +2 -1
index 42a35e0..e513d16 100644
@@ -517,7 +517,8 @@ static void code_gen_alloc(unsigned long tb_size)
             exit(1);
         }
     }
-#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__)
+#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__) \
+    || defined(__DragonFly__) || defined(__OpenBSD__)
     {
         int flags;
         void *addr = NULL;
Signature · 7 lines
1.7.3.2


-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
#1 lore raw

Am 21.12.2010 um 03:25 schrieb Brad:

Quoted 11 lines

---
exec.c | 3 ++-

1 files changed, 2 insertions(+), 1 deletions(-)
exec.c +0 -0
index 42a35e0..e513d16 100644

exec.c static void code_gen_alloc(unsigned long tb_size) · line 522

Quoted 7 lines
exec.c +2 -1
@@ -517,7 +517,8 @@ static void code_gen_alloc(unsigned long tb_size)
            exit(1);
        }
    }
-#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__) ||  
 defined(__DragonFly__)
+#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__) \
+    || defined(__DragonFly__) || defined(__OpenBSD__)

Brad, thanks for making me aware of this part of code! Haiku is not handled here either, falling back to malloc(), which breaks there.

When using mmap() on Haiku, weird qemu_malloc() workarounds with BeOS areas are no longer necessary.

As for a fix, shouldn't we do this the autoconf way and do feature tests rather than testing for known platforms? I.e. #elif defined(HAVE_MMAP) with HAVE_MMAP getting defined by configure?

Andreas

Quoted 5 lines
exec.c +0 -0
    {
        int flags;
        void *addr = NULL;
Signature · 1 line
1.7.3.2
author
#2 lore raw

----- Original message -----

Quoted 24 lines

Am 21.12.2010 um 03:25 schrieb Brad:

Quoted 11 lines

---
exec.c |      3 ++-

1 files changed, 2 insertions(+), 1 deletions(-)
exec.c +0 -0
index 42a35e0..e513d16 100644

exec.c static void code_gen_alloc(unsigned long tb_size) · line 522

Quoted 7 lines
exec.c +2 -1
@@ -517,7 +517,8 @@ static void code_gen_alloc(unsigned long tb_size)
 exit(1);
 }
 }
-#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__) ||   
 defined(__DragonFly__)
+#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__) \
+       || defined(__DragonFly__) || defined(__OpenBSD__)

Brad, thanks for making me aware of this part of code! Haiku is not handled here either, falling back to malloc(), which breaks there.

Quoted 6 lines

When using mmap() on Haiku, weird qemu_malloc() workarounds with BeOS areas are no longer necessary.

As for a fix, shouldn't we do this the autoconf way and do feature tests rather than testing for known platforms? I.e. #elif defined(HAVE_MMAP) with HAVE_MMAP getting defined by configure?

Well I think it would be nice if possible to try and eliminate such hardcoded lists of Operating Systems via ifdefs and try to test for the features instead.

Signature · 3 lines
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.