You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You mention in the README that "Ruby objects must be kept on the stack". This, in fact, is only required if your code might trigger GC. But I'm actually asking about how to ensure that this VALUE isn't optimized away by the compiler or stored in a register? AFAIK, in Ruby C API, volatile is used, but it's main purpose is a bit different and Rust's {read,write}_volatile covers it, but not Ruby's keep it on the stack need. But I'm not really sure about this as Ruby's docs - at least what I've found - don't cover this and I'm experienced in C. Can you please clarify the Rust part?
UPD: Found info about RB_GC_GUARD, maybe it's worth mentioning?
The text was updated successfully, but these errors were encountered:
You mention in the README that "Ruby objects must be kept on the stack". This, in fact, is only required if your code might trigger GC. But I'm actually asking about how to ensure that this
VALUE
isn't optimized away by the compiler or stored in a register? AFAIK, in Ruby C API,volatile
is used, but it's main purpose is a bit different and Rust's{read,write}_volatile
covers it, but not Ruby'skeep it on the stack
need. But I'm not really sure about this as Ruby's docs - at least what I've found - don't cover this and I'm experienced in C. Can you please clarify the Rust part?UPD: Found info about
RB_GC_GUARD
, maybe it's worth mentioning?The text was updated successfully, but these errors were encountered: