summaryrefslogtreecommitdiff
path: root/malloc.c
diff options
context:
space:
mode:
authorIvan Maidanski <ivmai@mail.ru>2011-07-26 13:31:21 +0200
committerIvan Maidanski <ivmai@mail.ru>2011-07-26 13:31:21 +0200
commite955362cfcef47fdc3ad2140f50ea4638fd86a4d (patch)
tree07b9d240b8bc1a7be60cc79c1ce1e43866e2b4a7 /malloc.c
parentc63ec8250de446bca83601966c918d37ad120a83 (diff)
gc5.0alpha3 tarball importgc5_0alpha3
Diffstat (limited to 'malloc.c')
-rw-r--r--malloc.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/malloc.c b/malloc.c
index 37da584..66e62d2 100644
--- a/malloc.c
+++ b/malloc.c
@@ -93,8 +93,16 @@ register ptr_t *opp;
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, 0)) == 0
- && GC_collect_or_expand(n_blocks, FALSE));
+ h = GC_allochblk(lw, k, 0);
+# ifdef USE_MUNMAP
+ if (0 == h) {
+ GC_merge_unmapped();
+ h = GC_allochblk(lw, k, 0);
+ }
+# endif
+ while (0 == h && GC_collect_or_expand(n_blocks, FALSE)) {
+ h = GC_allochblk(lw, k, 0);
+ }
if (h == 0) {
op = 0;
} else {