summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--allchblk.c2
-rw-r--r--alloc.c6
-rw-r--r--include/private/gc_priv.h1
3 files changed, 4 insertions, 5 deletions
diff --git a/allchblk.c b/allchblk.c
index d5941a03..72eec253 100644
--- a/allchblk.c
+++ b/allchblk.c
@@ -691,7 +691,7 @@ GC_allochblk(size_t sz, int kind, unsigned flags/* IGNORE_OFF_PAGE or 0 */)
may_split = TRUE;
if (GC_use_entire_heap || GC_dont_gc
- || USED_HEAP_SIZE < GC_requested_heapsize
+ || GC_heapsize - GC_large_free_bytes < GC_requested_heapsize
|| GC_incremental || !GC_should_collect()) {
/* Should use more of the heap, even if it requires splitting. */
split_limit = N_HBLK_FLS;
diff --git a/alloc.c b/alloc.c
index 503d9e8b..83a12e7d 100644
--- a/alloc.c
+++ b/alloc.c
@@ -1219,11 +1219,11 @@ STATIC void GC_finish_collection(void)
+ sizeof(GC_arrays)));
GC_DBGLOG_PRINT_HEAP_IN_USE();
if (GC_is_full_gc) {
- GC_used_heap_size_after_full = USED_HEAP_SIZE;
+ GC_used_heap_size_after_full = GC_heapsize - GC_large_free_bytes;
GC_need_full_gc = FALSE;
} else {
- GC_need_full_gc = USED_HEAP_SIZE - GC_used_heap_size_after_full
- > min_bytes_allocd();
+ GC_need_full_gc = GC_heapsize - GC_used_heap_size_after_full
+ > min_bytes_allocd() + GC_large_free_bytes;
}
/* Reset or increment counters for next cycle */
diff --git a/include/private/gc_priv.h b/include/private/gc_priv.h
index 4d70ab0b..82ed600c 100644
--- a/include/private/gc_priv.h
+++ b/include/private/gc_priv.h
@@ -1681,7 +1681,6 @@ GC_API_PRIV GC_FAR struct _GC_arrays GC_arrays;
#define beginGC_arrays ((ptr_t)(&GC_arrays))
#define endGC_arrays (((ptr_t)(&GC_arrays)) + (sizeof GC_arrays))
-#define USED_HEAP_SIZE (GC_heapsize - GC_large_free_bytes)
/* Object kinds: */
#ifndef MAXOBJKINDS