summaryrefslogtreecommitdiff
path: root/gc.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-09-26 19:40:49 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-09-26 19:40:49 +0000
commitb416cc6f3f843fd17cef94bdb10eb6af63fd5b18 (patch)
treef719a4464d14c893f0e22317f3a08df7476e1cb7 /gc.c
parent71341b814a863ffd95f9fc640c1d62ae83b668f8 (diff)
* 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
Diffstat (limited to 'gc.c')
-rw-r--r--gc.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/gc.c b/gc.c
index 2d19e7c98b..3a073d39d8 100644
--- a/gc.c
+++ b/gc.c
@@ -784,6 +784,26 @@ rb_mark_tbl(st_table *tbl)
}
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)
{
gc_mark(key, lev);