diff options
author | Xavier Leroy <xavier.leroy@inria.fr> | 2008-01-03 09:37:10 +0000 |
---|---|---|
committer | Xavier Leroy <xavier.leroy@inria.fr> | 2008-01-03 09:37:10 +0000 |
commit | a3c0366f4e41bed30ba2170d782d06fbbfd1b8ba (patch) | |
tree | 66860726f88e849cf14c8d454aee8cdc57039623 /byterun/unix.c | |
parent | 4235c38b7f172d84ac2a8f6a50f0a58ce32d5b03 (diff) |
PR#4448: replace dense page table by sparse hash table.
Introduction and use of macros Is_in_value_area, Is_in_heap_or_young.
Removal of USE_MMAP_INSTEAD_OF_MALLOC.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@8743 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
Diffstat (limited to 'byterun/unix.c')
-rw-r--r-- | byterun/unix.c | 46 |
1 files changed, 0 insertions, 46 deletions
diff --git a/byterun/unix.c b/byterun/unix.c index 0eb979f0a..00b27de74 100644 --- a/byterun/unix.c +++ b/byterun/unix.c @@ -387,52 +387,6 @@ char * caml_dlerror(void) #endif -#ifdef USE_MMAP_INSTEAD_OF_MALLOC - -/* The code below supports the use of mmap() rather than malloc() - for allocating the chunks composing the major heap. - This code is needed on 64-bit Linux platforms, where the native - malloc() implementation can return pointers several *exabytes* apart, - (some coming from mmap(), other from sbrk()); this makes the - page table *way* too large. */ - -#include <sys/mman.h> - -char *caml_aligned_mmap (asize_t size, int modulo, void **block) -{ - char *raw_mem; - uintnat aligned_mem; - Assert (modulo < Page_size); - raw_mem = (char *) mmap(NULL, size + Page_size, PROT_READ | PROT_WRITE, - MAP_PRIVATE | MAP_ANONYMOUS, -1, 0); - if (raw_mem == MAP_FAILED) return NULL; - *block = raw_mem; - raw_mem += modulo; /* Address to be aligned */ - aligned_mem = (((uintnat) raw_mem / Page_size + 1) * Page_size); -#ifdef DEBUG - { - uintnat *p; - uintnat *p0 = (void *) *block, - *p1 = (void *) (aligned_mem - modulo), - *p2 = (void *) (aligned_mem - modulo + size), - *p3 = (void *) ((char *) *block + size + Page_size); - - for (p = p0; p < p1; p++) *p = Debug_filler_align; - for (p = p1; p < p2; p++) *p = Debug_uninit_align; - for (p = p2; p < p3; p++) *p = Debug_filler_align; - } -#endif - return (char *) (aligned_mem - modulo); -} - -void caml_aligned_munmap (char * addr, asize_t size) -{ - int retcode = munmap (addr, size + Page_size); - Assert(retcode == 0); -} - -#endif - /* Add to [contents] the (short) names of the files contained in the directory named [dirname]. No entries are added for [.] and [..]. Return 0 on success, -1 on error; set errno in the case of error. */ |