summaryrefslogtreecommitdiff
path: root/boehm-gc/mallocx.c
diff options
context:
space:
mode:
authortromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4>1999-11-01 23:15:51 +0000
committertromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4>1999-11-01 23:15:51 +0000
commit9bc8642e1f366a35c305b9abe9e01bf934b584b9 (patch)
tree9c24ba1ebabff472b9caddbff07ef957dbf2c24c /boehm-gc/mallocx.c
parent79eaf784f16b0e8079d9dca062a0fc959d289d18 (diff)
downloadgcc-9bc8642e1f366a35c305b9abe9e01bf934b584b9.tar.gz
Merged GC 5.0alpha4 with local changes, plus:
* Makefile.in: Rebuilt. * Makefile.am (gctest_LDADD): Added THREADLIB. (TESTS): New macro. * configure: Rebuilt. * configure.in (INCLUDES): New subst. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@30332 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'boehm-gc/mallocx.c')
-rw-r--r--boehm-gc/mallocx.c16
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();