From 2a4c4f7b0c147585119036c43c1d04f73621e510 Mon Sep 17 00:00:00 2001 From: akr Date: Wed, 29 Aug 2007 23:12:21 +0000 Subject: * include/ruby/intern.h: declare rb_hash_tbl. * include/ruby/ruby.h (RHash): delay st_table allocation. rename tbl field to ntbl to detect direct reference to the st_table as a compile error. (RHASH_TBL): abstract accessor defined. (RHASH_ITER_LEV): ditto. (RHASH_IFNONE): ditto. (RHASH_SIZE): ditto. (RHASH_EMPTY_P): ditto. * hash.c: delay st_table allocation. * gc.c: replace tbl by ntbl. * array.c: replace direct field accessor by abstract field accessor such as RHASH(hash)->tbl to RHASH_TBL(hash). * marshal.c: ditto. * insns.def: ditto. * ext/iconv/iconv.c: ditto. * ext/json/ext/generator/generator.c: ditto. * ext/json/ext/parser/parser.c: ditto. * ext/syck/rubyext.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13309 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- marshal.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'marshal.c') diff --git a/marshal.c b/marshal.c index b4ba9b6140..79e559d7f3 100644 --- a/marshal.c +++ b/marshal.c @@ -578,7 +578,7 @@ w_object(VALUE obj, struct dump_arg *arg, int limit) else { w_byte(TYPE_HASH_DEF, arg); } - w_long(RHASH(obj)->tbl->num_entries, arg); + w_long(RHASH_SIZE(obj), arg); rb_hash_foreach(obj, hash_each, (st_data_t)&c_arg); if (!NIL_P(RHASH(obj)->ifnone)) { w_object(RHASH(obj)->ifnone, arg, limit); @@ -899,7 +899,7 @@ r_string(struct load_arg *arg) static VALUE r_entry(VALUE v, struct load_arg *arg) { - rb_hash_aset(arg->data, INT2FIX(RHASH(arg->data)->tbl->num_entries), v); + rb_hash_aset(arg->data, INT2FIX(RHASH_SIZE(arg->data)), v); if (arg->taint) OBJ_TAINT(v); if (arg->proc) { v = rb_funcall(arg->proc, rb_intern("call"), 1, v); -- cgit v1.2.3