We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 34b8a14 commit f843fdaCopy full SHA for f843fda
ext/witapi/witapi-core.c
@@ -331,6 +331,11 @@ bool rb_abi_guest_rb_gc_enable(void) { return rb_gc_enable() == Qtrue; }
331
332
VALUE rb_gc_disable_no_rest(void);
333
bool rb_abi_guest_rb_gc_disable(void) {
334
+ // NOTE: rb_gc_disable() is usually preferred to free up memory as much as
335
+ // possible before disabling GC. However it may trigger GC through gc_rest(),
336
+ // and triggering GC having a sandwitched JS frame is unsafe because it misses
337
+ // to mark some living objects in the frames behind the JS frame. So we use
338
+ // rb_gc_disable_no_rest(), which does not trigger GC, instead.
339
return rb_gc_disable_no_rest() == Qtrue;
340
}
341
0 commit comments