summaryrefslogtreecommitdiff
path: root/symbol.h
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2019-04-25 13:22:06 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2019-04-25 13:22:06 +0900
commitd0ba4abf1a00339ebbb5d405db3240a8bdb7b68b (patch)
tree2360aec2e1044cc2aa2ca81e5407f52b26b7c028 /symbol.h
parent99084f540171df301478ec66fb89e2c38287e504 (diff)
Add RB_ID_SERIAL_MAX
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 3b9866d80f..4b5c676d55 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);
typedef struct {
rb_id_serial_t last_id;