Join GitHub today
RB_GC_GUARD to protect from premature GC #283
I have been auditing some third-party Gems for memory errors in our app, which I believe are caused by premature GC in C extensions.
In each of these writer functions,
The self VALUE is on the Ruby call stack so will not be GCed. That is true of any argument on the Ruby call stack. If the object were allocated in the C function that would be a potential problem with being GCed early but that is not the case in the changes you made.