summaryrefslogtreecommitdiff
path: root/mallocx.c
diff options
context:
space:
mode:
authorIvan Maidanski <ivmai@mail.ru>2011-07-26 15:31:21 +0400
committerIvan Maidanski <ivmai@mail.ru>2011-07-26 15:31:21 +0400
commite955362cfcef47fdc3ad2140f50ea4638fd86a4d (patch)
tree07b9d240b8bc1a7be60cc79c1ce1e43866e2b4a7 /mallocx.c
parentc63ec8250de446bca83601966c918d37ad120a83 (diff)
downloadbdwgc-e955362cfcef47fdc3ad2140f50ea4638fd86a4d.tar.gz
gc5.0alpha3 tarball importgc5_0alpha3
Diffstat (limited to 'mallocx.c')
-rw-r--r--mallocx.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/mallocx.c b/mallocx.c
index b1450215..8c07fa98 100644
--- a/mallocx.c
+++ b/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 {