Description
Due to destructors and the cycle collector, zval_ptr_dtor() may have more effects than just freeing the given zval. This is the cause of bugs and workarounds.
These bugs and workarounds could be avoided by delaying destructors and GC runs until a safepoint is reached. If we use vm interrupts as safepoints, this would delay destructors until the next branch/loop or function call (this should be defined more precisely), which seems reasonable.
I'm creating this ticket to aggregate issues that would not exist with delayed destructors and GC runs:
#19787 delays GC runs, but not destructors.
Description
Due to destructors and the cycle collector,
zval_ptr_dtor()may have more effects than just freeing the given zval. This is the cause of bugs and workarounds.These bugs and workarounds could be avoided by delaying destructors and GC runs until a safepoint is reached. If we use vm interrupts as safepoints, this would delay destructors until the next branch/loop or function call (this should be defined more precisely), which seems reasonable.
I'm creating this ticket to aggregate issues that would not exist with delayed destructors and GC runs:
#19787 delays GC runs, but not destructors.