summaryrefslogtreecommitdiff
path: root/ractor.c
diff options
context:
space:
mode:
authorAaron Patterson <tenderlove@ruby-lang.org>2022-08-23 13:23:40 -0700
committerAaron Patterson <aaron.patterson@gmail.com>2022-08-24 10:54:27 -0700
commit28a3434634a0116a6f2b9e2df0bcbbfb0cfbd28b (patch)
treed2a62aa0e4808343a8b9b0b2156e70f6838e4be6 /ractor.c
parentfa9f4d387c2a46553051f01f4a28ae17d874e4c7 (diff)
downloadruby-28a3434634a0116a6f2b9e2df0bcbbfb0cfbd28b.tar.gz
Disable Ractor check on 32bit architectures
Ractor verification requires storing the ractor id in the top 32 bits of the object header. Unfortunately 32 bit machines only have 32 bits in the object header. The verification code has a 32 bit left shift which doesn't work on i686 and will clobber existing flags. This commit disables the verification code on i686 since i686 will crash if it's enabled. Co-Authored-By: John Hawthorn <john@hawthorn.email> Co-Authored-By: Jemma Issroff <jemmaissroff@gmail.com>
Diffstat (limited to 'ractor.c')
-rw-r--r--ractor.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/ractor.c b/ractor.c
index 0306736c18..0eddc165fa 100644
--- a/ractor.c
+++ b/ractor.c
@@ -74,7 +74,9 @@ static void
ractor_lock_self(rb_ractor_t *cr, const char *file, int line)
{
VM_ASSERT(cr == GET_RACTOR());
+#if RACTOR_CHECK_MODE > 0
VM_ASSERT(cr->sync.locked_by != cr->pub.self);
+#endif
ractor_lock(cr, file, line);
}
@@ -94,7 +96,9 @@ static void
ractor_unlock_self(rb_ractor_t *cr, const char *file, int line)
{
VM_ASSERT(cr == GET_RACTOR());
+#if RACTOR_CHECK_MODE > 0
VM_ASSERT(cr->sync.locked_by == cr->pub.self);
+#endif
ractor_unlock(cr, file, line);
}