Skip to content

Commit

Permalink
Use noinline version of accessing current ec
Browse files Browse the repository at this point in the history
On universal.arm64e-darwin22 with clang 15.0.0 (I didn't check
details yet) accessing `ruby_current_ec` directly causes
assertion violation `VM_ASSERT(ec == rb_current_ec_noinline())`
on `rb_current_execution_context()`, maybe because TLS accessing
issue.
  • Loading branch information
ko1 committed Dec 24, 2023
1 parent 541371e commit a87ae24
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion thread_pthread.h
Expand Up @@ -134,7 +134,7 @@ struct rb_thread_sched {

# ifdef __APPLE__
// on Darwin, TLS can not be accessed across .so
struct rb_execution_context_struct *rb_current_ec(void);
NOINLINE(struct rb_execution_context_struct *rb_current_ec(void));
# else
RUBY_EXTERN RB_THREAD_LOCAL_SPECIFIER struct rb_execution_context_struct *ruby_current_ec;

Expand Down

0 comments on commit a87ae24

Please sign in to comment.