diff options
author | Ivan Maidanski <ivmai@mail.ru> | 2018-05-18 10:58:54 +0300 |
---|---|---|
committer | Ivan Maidanski <ivmai@mail.ru> | 2018-05-18 10:58:54 +0300 |
commit | 73d30d2b4f7b16473c38036a5ad409deb296ac4a (patch) | |
tree | 2a7af440e09d179a7bbad1da6b5c542fd9c900dc /specific.c | |
parent | f30c01500208d4c459986a32cd4e36bc2a483789 (diff) |
Fix missing GC_dirty calls for GC-allocated objects used internally
This change matters only in case of MANUAL_VDB mode.
* finalize.c (GC_grow_table, GC_register_disappearing_link,
GC_unregister_disappearing_link_inner, GC_process_togglerefs,
GC_toggleref_add, GC_move_disappearing_link_inner,
GC_register_finalizer_inner, ITERATE_DL_HASHTBL_END,
DELETE_DL_HASHTBL_ENTRY, GC_finalize, GC_enqueue_all_finalizers): Call
GC_dirty where needed.
* gcj_mlc.c [GC_GCJ_SUPPORT] (GC_gcj_malloc, GC_debug_gcj_malloc,
GC_gcj_malloc_ignore_off_page): Likewise.
* pthread_start.c [GC_PTHREADS && !GC_WIN32_THREADS]
(GC_inner_start_routine): Likewise.
* pthread_support.c [GC_PTHREADS && !GC_WIN32_THREADS] (GC_new_thread,
GC_delete_thread, GC_delete_gc_thread): Likewise.
* specific.c [USE_CUSTOM_SPECIFIC] (GC_setspecific,
GC_remove_specific_after_fork): Likewise.
* typd_mlc.c (GC_make_sequence_descriptor, GC_malloc_explicitly_typed,
GC_malloc_explicitly_typed_ignore_off_page, GC_calloc_explicitly_typed):
Likewise.
* win32_threads.c (GC_new_thread, GC_delete_gc_thread_no_free,
GC_delete_thread, GC_CreateThread): Likewise.
* win32_threads.c [!CYGWIN32 && !MSWINCE && !MSWIN_XBOX1]
(GC_beginthreadex): Likewise.
* win32_threads.c [GC_PTHREADS] (GC_pthread_create,
GC_pthread_start_inner): Likewise.
* include/gc_inline.h (GC_FAST_MALLOC_GRANS): Call
GC_end_stubborn_change(my_fl) after GC_FAST_M_AO_STORE() call unless
kind is GC_I_PTRFREE.
* include/gc_inline.h (GC_CONS): Call GC_end_stubborn_change(result).
Diffstat (limited to 'specific.c')
-rw-r--r-- | specific.c | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -70,6 +70,8 @@ GC_INNER int GC_setspecific(tsd * key, void * value) /* There can only be one writer at a time, but this needs to be */ /* atomic with respect to concurrent readers. */ AO_store_release(&key->hash[hash_val].ao, (AO_t)entry); + GC_dirty((/* no volatile */ void *)entry); + GC_dirty(key->hash + hash_val); pthread_mutex_unlock(&(key -> lock)); return 0; } @@ -101,8 +103,10 @@ GC_INNER void GC_remove_specific_after_fork(tsd * key, pthread_t t) entry -> qtid = INVALID_QTID; if (NULL == prev) { key->hash[hash_val].p = entry->next; + GC_dirty(key->hash + hash_val); } else { prev->next = entry->next; + GC_dirty(prev); } /* Atomic! concurrent accesses still work. */ /* They must, since readers don't lock. */ |