2
Share
Share on Mastodon
Share on Twitter
Share on Facebook
Share on Linkedin
Aaron Patterson ✅

@bascule @thisismissem I am not enough an expert in Rust (and the machine code it generates) to say whether or not you're right, but I trust you! 😆 A core issue though is that you need to know the machine code the compiler generates to know whether or not you need a guard. I feel like "knowing the machine code the Rust compiler generates" is not something people sign up for when writing a Rust extension, and that's where the danger is

1
12mo
Catherine

@bascule @thisismissem I would probably replicate the same inline assembly that Ruby uses; that (when used with a stack slot) clearly marks the stack slot address as escaping, whereas I'm not quite so sure about volatile_read

@tenderlove it seems like somebody could build a reusable library providing a rb_gc_guard!() macro with the same function, no?

1
12mo
Replies