change mrb_sym type from uint16_t to uint32_t

parent 48c5321d
......@@ -161,7 +161,6 @@ typedef struct mrb_state {
mrb_bool gc_full:1;
mrb_bool is_generational_gc_mode:1;
mrb_bool out_of_memory:1;
mrb_bool symbol_table_overflow:1;
size_t majorgc_old_threshold;
struct alloca_header *mems;
......
......@@ -7,7 +7,7 @@
#ifndef MRUBY_VALUE_H
#define MRUBY_VALUE_H
typedef uint16_t mrb_sym;
typedef uint32_t mrb_sym;
typedef uint8_t mrb_bool;
struct mrb_state;
......
......@@ -45,14 +45,6 @@ sym_validate_len(mrb_state *mrb, size_t len)
}
}
#define MRB_SYM_MAX UINT16_MAX
static mrb_value
sym_tbl_overflow_new_str(mrb_state *mrb, const char *name, size_t len)
{
return mrb_str_inspect(mrb, mrb_str_new(mrb, name, len));
}
static mrb_sym
sym_intern(mrb_state *mrb, const char *name, size_t len, mrb_bool lit)
{
......@@ -70,19 +62,6 @@ sym_intern(mrb_state *mrb, const char *name, size_t len, mrb_bool lit)
if (k != kh_end(h))
return kh_value(h, k);
if (mrb->symbol_table_overflow) {
if (mrb->symidx == MRB_SYM_MAX) {
mrb_bug(mrb, "symbol table overflow (symbol %S)", sym_tbl_overflow_new_str(mrb, name, len));
}
}
else {
if (mrb->symidx >= MRB_SYM_MAX - 8) { /* raising might intern a few new strings */
mrb->symbol_table_overflow = TRUE;
mrb_raisef(mrb, E_RUNTIME_ERROR, "symbol table overflow (symbol %S)",
sym_tbl_overflow_new_str(mrb, name, len));
}
}
sym = ++mrb->symidx;
if (lit) {
sname.name = name;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment