diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-09-26 19:40:49 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-09-26 19:40:49 +0000 |
commit | ee5a8e05c4dfcab140aaa0049cb6d35fed2a3db1 (patch) | |
tree | f719a4464d14c893f0e22317f3a08df7476e1cb7 /gc.c | |
parent | 77a15a271f52024ae2615a8a709b29ac9c45c40f (diff) | |
download | ruby-ee5a8e05c4dfcab140aaa0049cb6d35fed2a3db1.tar.gz ruby-ee5a8e05c4dfcab140aaa0049cb6d35fed2a3db1.tar.xz ruby-ee5a8e05c4dfcab140aaa0049cb6d35fed2a3db1.zip |
* 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: http://svn.ruby-lang.org/repos/ruby/trunk@13528 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'gc.c')
-rw-r--r-- | gc.c | 20 |
1 files changed, 20 insertions, 0 deletions
@@ -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); |