summaryrefslogtreecommitdiff
path: root/allchblk.c
diff options
context:
space:
mode:
authorIvan Maidanski <ivmai@mail.ru>2022-04-28 09:49:36 +0300
committerIvan Maidanski <ivmai@mail.ru>2022-04-29 08:20:46 +0300
commit4bd63aa8202f0f794c91168f81c54938f67d1d80 (patch)
tree4fbcfbb586f8dac008023d2f17733927732aa606 /allchblk.c
parent78ce98ebac7066e8799762c1fc4f8bbc754756a6 (diff)
downloadbdwgc-4bd63aa8202f0f794c91168f81c54938f67d1d80.tar.gz
Remove USED_HEAP_SIZE macro
(refactoring) * allchblk.c (GC_allochblk): Replace USED_HEAP_SIZE to GC_heapsize-GC_large_free_bytes. * alloc.c (GC_finish_collection): Likewise. * alloc.c (GC_finish_collection): Avoid potential underflow when subtracting GC_used_heap_size_after_full from USED_HEAP_SIZE. * include/private/gc_priv.h (USED_HEAP_SIZE): Remove macro.
Diffstat (limited to 'allchblk.c')
-rw-r--r--allchblk.c2
1 files changed, 1 insertions, 1 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;