diff options
author | Alain Frisch <alain@frisch.fr> | 2008-04-09 16:32:09 +0000 |
---|---|---|
committer | Alain Frisch <alain@frisch.fr> | 2008-04-09 16:32:09 +0000 |
commit | 7332e6d6d3aa8743e167a506581962d105bf7788 (patch) | |
tree | ee8827eeca7bb8fcae8207422c42a19160e256e4 /byterun/unix.c | |
parent | cbfeebb112b7a3e396e26606fd3b7cd0a198e79d (diff) | |
download | ocaml-cducetrunk.tar.gz |
Merge from diff ocaml3100/ocaml3102: cvs update -j ocaml3100 -j ocaml3102 -kkcducetrunk
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/cducetrunk@8864 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
Diffstat (limited to 'byterun/unix.c')
-rw-r--r-- | byterun/unix.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/byterun/unix.c b/byterun/unix.c index 7d3f857883..dc07109eac 100644 --- a/byterun/unix.c +++ b/byterun/unix.c @@ -350,10 +350,13 @@ char *caml_aligned_mmap (asize_t size, int modulo, void **block) { char *raw_mem; uintnat aligned_mem; + static char * last_addr = NULL; /* hint, see PR#4448 */ + Assert (modulo < Page_size); - raw_mem = (char *) mmap(NULL, size + Page_size, PROT_READ | PROT_WRITE, + raw_mem = (char *) mmap(last_addr, size + Page_size, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0); if (raw_mem == MAP_FAILED) return NULL; + last_addr = raw_mem + size + 2 * Page_size; *block = raw_mem; raw_mem += modulo; /* Address to be aligned */ aligned_mem = (((uintnat) raw_mem / Page_size + 1) * Page_size); |