mirror of
https://github.com/ashinn/chibi-scheme.git
synced 2025-05-22 07:09:18 +02:00
Merge pull request #578 from katterjohn/mmap-heap-fixes
Fixes for mmapped heaps
This commit is contained in:
commit
544eaa79c7
1 changed files with 4 additions and 3 deletions
7
gc.c
7
gc.c
|
@ -500,12 +500,13 @@ sexp_heap sexp_make_heap (size_t size, size_t max_size, size_t chunk_size) {
|
||||||
sexp_free_list free, next;
|
sexp_free_list free, next;
|
||||||
sexp_heap h;
|
sexp_heap h;
|
||||||
#if SEXP_USE_MMAP_GC
|
#if SEXP_USE_MMAP_GC
|
||||||
h = mmap(NULL, sexp_heap_pad_size(size), PROT_READ|PROT_WRITE|PROT_EXEC,
|
h = mmap(NULL, sexp_heap_pad_size(size), PROT_READ|PROT_WRITE,
|
||||||
MAP_ANON|MAP_PRIVATE, 0, 0);
|
MAP_ANON|MAP_PRIVATE, -1, 0);
|
||||||
|
if (h == MAP_FAILED) return NULL;
|
||||||
#else
|
#else
|
||||||
h = sexp_malloc(sexp_heap_pad_size(size));
|
h = sexp_malloc(sexp_heap_pad_size(size));
|
||||||
#endif
|
|
||||||
if (! h) return NULL;
|
if (! h) return NULL;
|
||||||
|
#endif
|
||||||
h->size = size;
|
h->size = size;
|
||||||
h->max_size = max_size;
|
h->max_size = max_size;
|
||||||
h->chunk_size = chunk_size;
|
h->chunk_size = chunk_size;
|
||||||
|
|
Loading…
Add table
Reference in a new issue