summaryrefslogtreecommitdiff
path: root/symbol.h
diff options
context:
space:
mode:
Diffstat (limited to 'symbol.h')
-rw-r--r--symbol.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/symbol.h b/symbol.h
index 1f0b139811..cc7f156997 100644
--- a/symbol.h
+++ b/symbol.h
@@ -53,6 +53,10 @@ id_type(ID id)
}
typedef uint32_t rb_id_serial_t;
+static const uint32_t RB_ID_SERIAL_MAX = /* 256M on LP32 */
+ UINT32_MAX >>
+ ((sizeof(ID)-sizeof(rb_id_serial_t))*CHAR_BIT < RUBY_ID_SCOPE_SHIFT ?
+ RUBY_ID_SCOPE_SHIFT : 0);
static inline rb_id_serial_t
rb_id_to_serial(ID id)