summaryrefslogtreecommitdiff
path: root/pthread_support.c
diff options
context:
space:
mode:
authorIvan Maidanski <ivmai@mail.ru>2023-04-25 09:35:16 +0300
committerIvan Maidanski <ivmai@mail.ru>2023-04-25 09:36:04 +0300
commit4bdf9b9c327673b71344a63e368d8b2386bae6af (patch)
tree32451d0a3b368b8c78db67fa34c794ac91bcff04 /pthread_support.c
parent2e5646ba3d954da3f45985630281aadfc686f55b (diff)
downloadbdwgc-4bdf9b9c327673b71344a63e368d8b2386bae6af.tar.gz
Do incremental mark some in GC_collect_a_little even if GC is disabled
Previous behavior was not documented but this API function did nothing in this case. That might cause a deadlock in the client code if the incremental collection was ongoing and the client called GC_collect_a_little() repeatedly (while the result is true). The new behavior, for the cause of disabled garbage collection, is to perform some amount of marking if the incremental collection is ongoing (but not stopping the world and, thus, not causing the memory reclaim to start), returning true if there is something more to mark. * alloc.c (GC_try_to_collect_inner): Change a loop to do-while one. * alloc.c (GC_collect_a_little): Do not check GC_dont_gc (i.e. call GC_collect_a_little_inner() unconditionally); add comment. * include/gc/gc.h (GC_collect_a_little): Update comment (describe the case when GC is disabled). * tests/gctest.c (check_heap_stats): Do not call GC_is_disabled(); add comment.
Diffstat (limited to 'pthread_support.c')
0 files changed, 0 insertions, 0 deletions