Commit 23721a7
authored
rb_gc_register_address() must be called after the variable was assigned (#345)
rb_gc_register_address() must be called after the variable was assigned. Otherwise the GC might read the variable when it is not pointing to a Ruby object yet. TruffleRuby also assumes it can read the pointer when rb_gc_register_address() is called: truffleruby/truffleruby#2720
* Prefer rb_gc_register_mark_object() since the variable is never reassigned
* Mark immediately after assigning the variable to prevent the VALUE to move by GC compaction on CRuby1 parent 6607e64 commit 23721a7
1 file changed
+3
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
265 | 265 | | |
266 | 266 | | |
267 | 267 | | |
268 | | - | |
269 | | - | |
270 | 268 | | |
271 | 269 | | |
| 270 | + | |
| 271 | + | |
272 | 272 | | |
| 273 | + | |
273 | 274 | | |
0 commit comments