We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 328e302 commit 3c66eb3Copy full SHA for 3c66eb3
vm_method.c
@@ -879,15 +879,16 @@ method_definition_reset(const rb_method_entry_t *me)
879
}
880
881
882
+static rb_atomic_t method_serial = 1;
883
+
884
rb_method_definition_t *
885
rb_method_definition_create(rb_method_type_t type, ID mid)
886
{
887
rb_method_definition_t *def;
888
def = ZALLOC(rb_method_definition_t);
889
def->type = type;
890
def->original_id = mid;
- static uintptr_t method_serial = 1;
- def->method_serial = method_serial++;
891
+ def->method_serial = (uintptr_t)RUBY_ATOMIC_FETCH_ADD(method_serial, 1);
892
def->ns = rb_current_namespace();
893
return def;
894
0 commit comments