[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [MIT-Scheme-devel] Attempted Clean-up of Mac OS X MIT Scheme Port
From: |
Jed Davis |
Subject: |
Re: [MIT-Scheme-devel] Attempted Clean-up of Mac OS X MIT Scheme Port |
Date: |
Sun, 21 Jan 2007 03:40:34 -0500 |
User-agent: |
Mutt/1.5.10i |
Chris Hanson wrote:
> This is unfortunately hard to fix, because the current implementation
> wants a large block of memory below 0x04000000. MacOS X apparently uses
> that part of the address space for other things. A similar problem
> happens in some GNU/Linux distributions, and also on Windows systems.
The trick for Mac OS X is to link with -Wl,-pagezero_size,04000000 (or
however much space is needed). This sets the size of the PROT_NONE area
at the bottom of virtual memory that traps null pointer accesses; the
linker will, necessarily, place all other load commands above it. Then,
one can mmap over it with MAP_FIXED, since it doesn't contain anything
whose loss would be a problem.
--
(let ((C call-with-current-continuation)) (apply (lambda (x y) (x y)) (map
((lambda (r) ((C C) (lambda (s) (r (lambda l (apply (s s) l)))))) (lambda
(f) (lambda (l) (if (null? l) C (lambda (k) (display (car l)) ((f (cdr l))
(C k))))))) '((#\J #\d #\D #\v #\s) (#\e #\space #\a #\i #\newline)))))