From b416cc6f3f843fd17cef94bdb10eb6af63fd5b18 Mon Sep 17 00:00:00 2001 From: nobu Date: Wed, 26 Sep 2007 19:40:49 +0000 Subject: * gc.c (rb_mark_set): new function to mark keys. * marshal.c (struct dump_arg, struct load_arg): added wrappers to mark data and compat_tbl entries. [ruby-dev:31870] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13528 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- gc.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'gc.c') diff --git a/gc.c b/gc.c index 2d19e7c98b..3a073d39d8 100644 --- a/gc.c +++ b/gc.c @@ -783,6 +783,26 @@ rb_mark_tbl(st_table *tbl) mark_tbl(tbl, 0); } +static int +mark_key(VALUE key, VALUE value, int lev) +{ + gc_mark(key, lev); + return ST_CONTINUE; +} + +static void +mark_set(st_table *tbl, int lev) +{ + if (!tbl) return; + st_foreach(tbl, mark_key, lev); +} + +void +rb_mark_set(st_table *tbl) +{ + mark_set(tbl, 0); +} + static int mark_keyvalue(VALUE key, VALUE value, int lev) { -- cgit v1.2.3