Skip to content

Commit bd2d684

Browse files
committed
Remove VM lock in register_static_symid
1 parent 42f9545 commit bd2d684

File tree

1 file changed

+1
-11
lines changed

1 file changed

+1
-11
lines changed

symbol.c

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@
5151
#define STATIC_SYM2ID(sym) RSHIFT((VALUE)(sym), RUBY_SPECIAL_SHIFT)
5252

5353
static ID register_static_symid(ID, const char *, long, rb_encoding *);
54-
static ID register_static_symid_str(ID, VALUE);
5554
#define REGISTER_SYMID(id, name) register_static_symid((id), (name), strlen(name), enc)
5655
#include "id.c"
5756

@@ -803,21 +802,12 @@ static ID
803802
register_static_symid(ID id, const char *name, long len, rb_encoding *enc)
804803
{
805804
VALUE str = rb_enc_str_new(name, len, enc);
806-
return register_static_symid_str(id, str);
807-
}
808-
809-
static ID
810-
register_static_symid_str(ID id, VALUE str)
811-
{
812805
OBJ_FREEZE(str);
813806
str = rb_fstring(str);
814807

815808
RUBY_DTRACE_CREATE_HOOK(SYMBOL, RSTRING_PTR(str));
816809

817-
GLOBAL_SYMBOLS_LOCKING(symbols) {
818-
// TODO: remove this function
819-
sym_find_or_insert_static_symbol_id(symbols, str, id);
820-
}
810+
sym_find_or_insert_static_symbol_id(&ruby_global_symbols, str, id);
821811

822812
return id;
823813
}

0 commit comments

Comments
 (0)