diff options
author | Jonathan Chambers <joncham@gmail.com> | 2021-09-13 18:28:53 -0400 |
---|---|---|
committer | Ivan Maidanski <ivmai@mail.ru> | 2023-02-14 17:15:52 +0300 |
commit | 0e63b3923b215fe8229aaeaab6d9bc6d0cd18965 (patch) | |
tree | fa86a6d26b1ae601966ccd34647fd94bbd6a2108 /win32_threads.c | |
parent | 272e61e4691a9e990fa94a071d739dfbfa836941 (diff) | |
download | bdwgc-0e63b3923b215fe8229aaeaab6d9bc6d0cd18965.tar.gz |
Add callback API to support ephemeron marking
(cherry-pick of 1a65adc, bb5ba42, 6f41d8d from Unity-Technologies/bdwgc)
When ephemerons marking results in pushing a large number of objects,
the mark stack may overflow. While the processing could be batched,
the simplest approach is to allow the callback to return false to
indicate a failure and increasing the mark stack size.
* include/gc/gc_mark.h (GC_on_mark_stack_empty_proc): New public type.
* include/gc/gc_mark.h (GC_set_on_mark_stack_empty,
GC_get_on_mark_stack_empty): New public function declaration.
* mark.c (GC_on_mark_stack_empty): New static variable.
* mark.c (GC_set_on_mark_stack_empty, GC_get_on_mark_stack_empty): New
function implementation.
* mark.c (GC_mark_some_inner): If GC_on_mark_stack_empty is non-zero
then call it and break if pushed new items or overflowed.
* tests/gctest.c [GC_PTHREADS] (main): Call GC_set_on_mark_stack_empty
and GC_get_on_mark_stack_empty.
Co-authored-by: Ivan Maidanski <ivmai@mail.ru>
Diffstat (limited to 'win32_threads.c')
0 files changed, 0 insertions, 0 deletions