summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKoichi Sasada <ko1@atdot.net>2019-07-31 11:30:23 +0900
committerKoichi Sasada <ko1@atdot.net>2019-07-31 11:32:14 +0900
commit312879693ffa88c0778baba2b6697f6e5f2f6116 (patch)
treee515b62bd9788ad7e73c02347575faaf538d1433
parent4979ba38fa070b4b9480f0da4b7c827e9eb768ab (diff)
move macro to internal.h for documentation.
13e84d5c0a changes enum to macro, but the flags usage information are lost in internal.h. It should be same place with other flags information.
-rw-r--r--hash.c1
-rw-r--r--internal.h4
2 files changed, 4 insertions, 1 deletions
diff --git a/hash.c b/hash.c
index b0e9b027fd..53fe79bfc0 100644
--- a/hash.c
+++ b/hash.c
@@ -1317,7 +1317,6 @@ iter_lev_in_ivar_set(VALUE hash, int lev)
rb_ivar_set_internal(hash, rb_intern("hash_iter_lev"), INT2FIX(lev));
}
-#define RHASH_LEV_MASK ((VALUE)RHASH_LEV_MAX << RHASH_LEV_SHIFT)
static int
iter_lev_in_flags(VALUE hash)
{
diff --git a/internal.h b/internal.h
index 1dbb3d3862..832428bd03 100644
--- a/internal.h
+++ b/internal.h
@@ -823,6 +823,10 @@ enum ruby_rhash_flags {
RHASH_AR_TABLE_BOUND_MASK = (FL_USER8|FL_USER9|FL_USER10|FL_USER11), /* FL 8..11 */
RHASH_AR_TABLE_BOUND_SHIFT = (FL_USHIFT+8),
+ // we can not put it in "enum" because it can exceed "int" range.
+#define RHASH_LEV_MASK (FL_USER13 | FL_USER14 | FL_USER15 | /* FL 13..19 */ \
+ FL_USER16 | FL_USER17 | FL_USER18 | FL_USER19)
+
#if USE_TRANSIENT_HEAP
RHASH_TRANSIENT_FLAG = FL_USER12, /* FL 12 */
#endif