Skip to content

Commit 2235fdb

Browse files
committed
Remove VM lock for rb_id_attrset
1 parent 9e105a5 commit 2235fdb

File tree

1 file changed

+13
-15
lines changed

1 file changed

+13
-15
lines changed

symbol.c

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -452,22 +452,20 @@ rb_id_attrset(ID id)
452452
}
453453

454454
bool error = false;
455-
GLOBAL_SYMBOLS_LOCKING(symbols) {
456-
/* make new symbol and ID */
457-
VALUE str = lookup_id_str(id);
458-
if (str) {
459-
str = rb_str_dup(str);
460-
rb_str_cat(str, "=", 1);
461-
if (sym_check_asciionly(str, false)) {
462-
rb_enc_associate(str, rb_usascii_encoding());
463-
}
464-
465-
VALUE sym = sym_find_or_insert_static_symbol(symbols, str);
466-
id = rb_sym2id(sym);
467-
}
468-
else {
469-
error = true;
455+
/* make new symbol and ID */
456+
VALUE str = lookup_id_str(id);
457+
if (str) {
458+
str = rb_str_dup(str);
459+
rb_str_cat(str, "=", 1);
460+
if (sym_check_asciionly(str, false)) {
461+
rb_enc_associate(str, rb_usascii_encoding());
470462
}
463+
464+
VALUE sym = sym_find_or_insert_static_symbol(&ruby_global_symbols, str);
465+
id = rb_sym2id(sym);
466+
}
467+
else {
468+
error = true;
471469
}
472470

473471
if (error) {

0 commit comments

Comments
 (0)