[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Guile-commits] 05/07: Fix default code allocator in Lightning
From: |
Andy Wingo |
Subject: |
[Guile-commits] 05/07: Fix default code allocator in Lightning |
Date: |
Mon, 20 Aug 2018 06:08:28 -0400 (EDT) |
wingo pushed a commit to branch lightning
in repository guile.
commit 4a9de64f81db8377b672c5a20773b3330fc0b0f3
Author: Andy Wingo <address@hidden>
Date: Mon Aug 20 08:59:19 2018 +0200
Fix default code allocator in Lightning
* libguile/lightning/lib/lightning.c (_jit_emit): The default code
allocator will simply mmap a code buffer, try to emit into that
buffer, and if it fails, try again with a larger buffer. However the
buffer size starts at 0, for some reason. Why? I can't see the
reason. Change the default to 4096. In the future we will need to
implement our own allocator anyway so that we can pack multiple JIT
runs in one page.
---
libguile/lightning/lib/lightning.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/libguile/lightning/lib/lightning.c
b/libguile/lightning/lib/lightning.c
index 613c19f..5217466 100644
--- a/libguile/lightning/lib/lightning.c
+++ b/libguile/lightning/lib/lightning.c
@@ -2070,6 +2070,9 @@ _jit_emit(jit_state_t *_jit)
#if defined(__sgi)
mmap_fd = open("/dev/zero", O_RDWR);
#endif
+ if (_jit->code.length == 0)
+ _jit->code.length = 4096;
+
_jit->code.ptr = mmap(NULL, _jit->code.length,
PROT_EXEC | PROT_READ | PROT_WRITE,
MAP_PRIVATE | MAP_ANON, mmap_fd, 0);
- [Guile-commits] branch lightning updated (3827769 -> d001503), Andy Wingo, 2018/08/20
- [Guile-commits] 06/07: Fix bounds on compiler-emitted JIT metadata, Andy Wingo, 2018/08/20
- [Guile-commits] 01/07: Add internal function mapping subr index to function, Andy Wingo, 2018/08/20
- [Guile-commits] 05/07: Fix default code allocator in Lightning,
Andy Wingo <=
- [Guile-commits] 02/07: Expose scm_vm_builtin_ref internally, Andy Wingo, 2018/08/20
- [Guile-commits] 04/07: Manual JIT interface via %jit-compile, Andy Wingo, 2018/08/20
- [Guile-commits] 07/07: JIT compilation tweaks, Andy Wingo, 2018/08/20
- [Guile-commits] 03/07: First implementation of a template JIT, Andy Wingo, 2018/08/20