diff options
author | Ivan Maidanski <ivmai@mail.ru> | 2022-01-12 11:12:47 +0300 |
---|---|---|
committer | Ivan Maidanski <ivmai@mail.ru> | 2022-01-12 20:57:14 +0300 |
commit | 9b4ac36d4af28cc8a050152ec0df8cbcee1ff56e (patch) | |
tree | fd40e2e06198d2b1fe75b0e91eb5dc75abe6e0cf /typd_mlc.c | |
parent | 7797312145631f10fa39e5ca9ef50170e0dc5076 (diff) | |
download | bdwgc-9b4ac36d4af28cc8a050152ec0df8cbcee1ff56e.tar.gz |
Check pointer tag in all mark procedures (E2K)
Issue #411 (bdwgc).
Do not mark objects if its pointer tag is non-zero, not only in
GC_mark_from and GC_push_all_eager, but also in add_back_edges,
GC_ignore_self_finalize_mark_proc, GC_typed_mark_proc and
GC_push_conditional_eager.
* backgraph.c [MAKE_BACK_GRAPH] (add_back_edges): Change type of
current_p local variable from word* to ptr_t.
* typd_mlc.c (GC_typed_mark_proc): Likewise.
* backgraph.c [MAKE_BACK_GRAPH] (add_back_edges): Use
LOAD_WORD_OR_CONTINUE() instead of direct dereference of current_p.
* finalize.c (GC_ignore_self_finalize_mark_proc): Likewise.
* mark.c [WRAP_MARK_SOME && PARALLEL_MARK] (GC_push_conditional_eager):
Likewise.
* typd_mlc.c (GC_typed_mark_proc): Likewise.
* finalize.c (GC_ignore_self_finalize_mark_proc): Rename q and r local
variables to current_p and q, respectively.
Diffstat (limited to 'typd_mlc.c')
-rw-r--r-- | typd_mlc.c | 11 |
1 files changed, 6 insertions, 5 deletions
@@ -344,20 +344,21 @@ STATIC mse * GC_typed_mark_proc(word * addr, mse * mark_stack_ptr, mse * mark_stack_limit, word env) { word bm = GC_ext_descriptors[env].ed_bitmap; - word * current_p = addr; - word current; + ptr_t current_p = (ptr_t)addr; ptr_t greatest_ha = (ptr_t)GC_greatest_plausible_heap_addr; ptr_t least_ha = (ptr_t)GC_least_plausible_heap_addr; DECLARE_HDR_CACHE; INIT_HDR_CACHE; - for (; bm != 0; bm >>= 1, current_p++) { + for (; bm != 0; bm >>= 1, current_p += sizeof(word)) { if (bm & 1) { - current = *current_p; + word current; + + LOAD_WORD_OR_CONTINUE(current, current_p); FIXUP_POINTER(current); if (current >= (word)least_ha && current <= (word)greatest_ha) { PUSH_CONTENTS((ptr_t)current, mark_stack_ptr, - mark_stack_limit, (ptr_t)current_p); + mark_stack_limit, current_p); } } } |