aboutsummaryrefslogtreecommitdiffstats
path: root/include/ruby/ruby.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/ruby/ruby.h')
-rw-r--r--include/ruby/ruby.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/include/ruby/ruby.h b/include/ruby/ruby.h
index 2dbf29956e..63cb7b417e 100644
--- a/include/ruby/ruby.h
+++ b/include/ruby/ruby.h
@@ -478,10 +478,15 @@ struct RRegexp {
struct RHash {
struct RBasic basic;
- struct st_table *tbl;
+ struct st_table *ntbl; /* maybe 0 */
int iter_lev;
VALUE ifnone;
};
+#define RHASH_TBL(h) rb_hash_tbl(h)
+#define RHASH_ITER_LEV(h) RHASH(h)->iter_lev
+#define RHASH_IFNONE(h) RHASH(h)->ifnone
+#define RHASH_SIZE(h) (RHASH(h)->ntbl ? RHASH(h)->ntbl->num_entries : 0)
+#define RHASH_EMPTY_P(h) (RHASH_SIZE(h) == 0)
struct RFile {
struct RBasic basic;