Skip to content
  • Peter Zhu's avatar
    f4476f0d
    Disable GC during RUBY_INTERNAL_EVENT_NEWOBJ · f4476f0d
    Peter Zhu authored
    We must disable GC when running RUBY_INTERNAL_EVENT_NEWOBJ hooks because
    the callback could call xmalloc which could potentially trigger a GC,
    and a lot of code is unsafe to trigger a GC right after an object has
    been allocated because they perform initialization for the object and
    assume that the GC does not trigger before then.
    f4476f0d
    Disable GC during RUBY_INTERNAL_EVENT_NEWOBJ
    Peter Zhu authored
    We must disable GC when running RUBY_INTERNAL_EVENT_NEWOBJ hooks because
    the callback could call xmalloc which could potentially trigger a GC,
    and a lot of code is unsafe to trigger a GC right after an object has
    been allocated because they perform initialization for the object and
    assume that the GC does not trigger before then.
Loading