summaryrefslogtreecommitdiff
path: root/mark_rts.c
diff options
context:
space:
mode:
authorhboehm <hboehm>2006-04-29 01:35:01 +0200
committerIvan Maidanski <ivmai@mail.ru>2011-07-26 19:06:37 +0200
commiteb1058e8240170cb3117a7dd6495f38f56439d70 (patch)
tree55f5c1c1f132abdb3ce5963ca456fdfee511d97c /mark_rts.c
parentf8eee17a4c7fb9bd2a930270063260b1b99b4eee (diff)
2006-04-28 Hans Boehm <Hans.Boehm@hp.com>
* mark_rts.c: Have GC_add_roots and GC_clear_roots initialize GC if necessary. * include/gc.h (GC_INIT): Remove redundant GC_init calls, add second precollection if roots were added late.
Diffstat (limited to 'mark_rts.c')
-rw-r--r--mark_rts.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/mark_rts.c b/mark_rts.c
index bd97c6e..00401a0 100644
--- a/mark_rts.c
+++ b/mark_rts.c
@@ -150,6 +150,7 @@ void GC_add_roots(void *b, void *e)
{
DCL_LOCK_STATE;
+ if (!GC_is_initialized) GC_init();
LOCK();
GC_add_roots_inner((ptr_t)b, (ptr_t)e, FALSE);
UNLOCK();
@@ -249,6 +250,7 @@ void GC_clear_roots (void)
{
DCL_LOCK_STATE;
+ if (!GC_is_initialized) GC_init();
LOCK();
roots_were_cleared = TRUE;
n_root_sets = 0;