Add GC_reachable_here after GC_dirty in GC source
authorIvan Maidanski <ivmai@mail.ru>
Fri, 22 Jun 2018 21:42:30 +0000 (00:42 +0300)
committerIvan Maidanski <ivmai@mail.ru>
Fri, 22 Jun 2018 21:42:30 +0000 (00:42 +0300)
commit8eb6f8d93fe7cb922969e47ec343e8dafb5cbb2b
tree11a28095ff6701fe4d387c726fd9f46daa6f7850
parent263ffbbfd303ac0a62e272ff23baa04139f2009b
Add GC_reachable_here after GC_dirty in GC source
(fix of commits 73d30d2b4e5fb574cf)

* README.md (Incremental Collection): Add note about bugs caused by
a missing GC_reachable_here call.
* doc/gcdescr.md (Generational Collection): Mention GC_reachable_here
for MANUAL_VDB mode.
* finalize.c (GC_register_disappearing_link_inner,
GC_register_finalizer_inner): Move GC_dirty(new_dl) call to be before
unlocking (so that to ensure no collection occurs between initialization
of new_dl and GC_dirty() call).
* finalize.c (GC_finalize): Call GC_dirty() immediately after updating
GC_fnlz_roots.fo_head (instead of setting needs_barrier) if
GC_object_finalized_proc is set.
* gcj_mlc.c (GC_gcj_malloc, GC_debug_gcj_malloc,
GC_gcj_malloc_ignore_off_page): Call
REACHABLE_AFTER_DIRTY(ptr_to_struct_containing_descr) after GC_dirty(op).
* include/gc.h (GC_end_stubborn_change): Mention GC_reachable_here
in comment.
* include/gc_inline.h (GC_FAST_MALLOC_GRANS): Call
GC_reachable_here(next) after GC_end_stubborn_change(my_fl); remove
GC_end_stubborn_change() call when a non-pointer is stored to my_fl;
remove GC_end_stubborn_change() after GC_generic_malloc_many() call.
* include/gc_inline.h (GC_CONS): Call GC_reachable_here for the stored
pointers after GC_end_stubborn_change call.
* include/private/gc_priv.h (REACHABLE_AFTER_DIRTY): New macro.
* mallocx.c [MANUAL_VDB] (GC_generic_malloc_many): If
GC_is_heap_ptr(result) then call GC_dirty(result) and
REACHABLE_AFTER_DIRTY(op) after storing op pointer.
* typd_mlc.c (GC_make_sequence_descriptor): Call REACHABLE_AFTER_DIRTY
for the stored pointers after GC_dirty(result).
* typd_mlc.c (GC_malloc_explicitly_typed,
GC_malloc_explicitly_typed_ignore_off_page, GC_calloc_explicitly_typed):
Call REACHABLE_AFTER_DIRTY(d) after GC_dirty(op).
* win32_threads.c (GC_CreateThread, GC_beginthreadex,
GC_pthread_create): Call REACHABLE_AFTER_DIRTY for the stored pointer
after GC_dirty.
README.md
doc/gcdescr.md
finalize.c
gcj_mlc.c
include/gc.h
include/gc_inline.h
include/private/gc_priv.h
mallocx.c
typd_mlc.c
win32_threads.c