summaryrefslogtreecommitdiff
path: root/alloc.c
diff options
context:
space:
mode:
authorIvan Maidanski <ivmai@mail.ru>2013-12-22 00:54:41 -0800
committerIvan Maidanski <ivmai@mail.ru>2013-12-22 00:54:41 -0800
commita23bae633e7a7a33c5034bc78cc2a632aa0d68ed (patch)
tree88ad4cc6a542b5c6140086622b37b14004f16e01 /alloc.c
parent786d20ab7a626380385399c8465839ca0ac669f7 (diff)
parentd30a448f3500f5951aec2ce014e7cdfdbe201484 (diff)
downloadbdwgc-a23bae633e7a7a33c5034bc78cc2a632aa0d68ed.tar.gz
Merge pull request #30 from Hoops/loop-in-GC_alloc_large
Loop in GC_alloc_large
Diffstat (limited to 'alloc.c')
-rw-r--r--alloc.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/alloc.c b/alloc.c
index 41b0caba..be6d4ed3 100644
--- a/alloc.c
+++ b/alloc.c
@@ -1087,6 +1087,16 @@ GC_INNER void GC_add_to_heap(struct hblk *p, size_t bytes)
phdr -> hb_flags = 0;
GC_freehblk(p);
GC_heapsize += bytes;
+
+ /* Normally the caller calculates a new GC_collect_at_heapsize,
+ * but this is also called directly from alloc_mark_stack, so
+ * adjust here. It will be recalculated when called from
+ * GC_expand_hp_inner.
+ */
+ GC_collect_at_heapsize += bytes;
+ if (GC_collect_at_heapsize < GC_heapsize /* wrapped */)
+ GC_collect_at_heapsize = (word)(-1);
+
if ((word)p <= (word)GC_least_plausible_heap_addr
|| GC_least_plausible_heap_addr == 0) {
GC_least_plausible_heap_addr = (void *)((ptr_t)p - sizeof(word));