diff options
Diffstat (limited to 'boehm-gc/mallocx.c')
-rw-r--r-- | boehm-gc/mallocx.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/boehm-gc/mallocx.c b/boehm-gc/mallocx.c index ae8bfffb8af..8c07fa98846 100644 --- a/boehm-gc/mallocx.c +++ b/boehm-gc/mallocx.c @@ -57,8 +57,16 @@ register int k; if(GC_incremental && !GC_dont_gc) GC_collect_a_little_inner((int)n_blocks); lw = ROUNDED_UP_WORDS(lb); - while ((h = GC_allochblk(lw, k, IGNORE_OFF_PAGE)) == 0 - && GC_collect_or_expand(n_blocks, TRUE)); + h = GC_allochblk(lw, k, IGNORE_OFF_PAGE); +# ifdef USE_MUNMAP + if (0 == h) { + GC_merge_unmapped(); + h = GC_allochblk(lw, k, IGNORE_OFF_PAGE); + } +# endif + while (0 == h && GC_collect_or_expand(n_blocks, TRUE)) { + h = GC_allochblk(lw, k, IGNORE_OFF_PAGE); + } if (h == 0) { op = 0; } else { @@ -130,7 +138,7 @@ void GC_incr_mem_freed(size_t n) ptr_t GC_generic_malloc_words_small(size_t lw, int k) #else ptr_t GC_generic_malloc_words_small(lw, k) - register size_t lw; + register word lw; register int k; #endif { @@ -148,7 +156,7 @@ DCL_LOCK_STATE; GC_init_inner(); } if (kind -> ok_reclaim_list != 0 || GC_alloc_reclaim_list(kind)) { - op = GC_clear_stack(GC_allocobj(lw, k)); + op = GC_clear_stack(GC_allocobj((word)lw, k)); } if (op == 0) { UNLOCK(); |