diff options
author | Ivan Maidanski <ivmai@mail.ru> | 2013-12-22 00:54:41 -0800 |
---|---|---|
committer | Ivan Maidanski <ivmai@mail.ru> | 2013-12-22 00:54:41 -0800 |
commit | a23bae633e7a7a33c5034bc78cc2a632aa0d68ed (patch) | |
tree | 88ad4cc6a542b5c6140086622b37b14004f16e01 /alloc.c | |
parent | 786d20ab7a626380385399c8465839ca0ac669f7 (diff) | |
parent | d30a448f3500f5951aec2ce014e7cdfdbe201484 (diff) | |
download | bdwgc-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.c | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -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)); |