tildeio / helix

Native Ruby extensions without fear
https://usehelix.com
ISC License
1.98k stars 60 forks source link

GC issues #50

Open chancancode opened 7 years ago

chancancode commented 7 years ago

If we:

  1. heap allocate a struct-based helix object (e.g. Duration::new)
  2. GC runs

It will GC the Ruby object associated with the helix object, because the GC couldn't see the VALUE pointer on the stack

See https://github.com/sparklemotion/nokogiri/commit/0a1556a7c0ac1dc58c074a06f639bba3ddabab3f and http://blog.reverberate.org/2016/06/12/native-extensions-memory-management-part1-ruby-mri.html

wagenet commented 7 years ago

Seems like we should be able to write a failing test for this, right?

wagenet commented 7 years ago

@chancancode @wycats is this still an issue?

chancancode commented 6 years ago

Until we allow calling back into the Ruby VM (thus opening up the possibility of triggering a GC pass mid-rust-frame), I don't think this could happen