You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Yeah sure. Cyclic references occur when you nest an object (or an array reference) within itself. In normal PHP code, this looks something like the following:
$o = newStdClass();
$o->prop = $o;
So the prop property references the object itself, forming a cycle. PHP has a mark-and-sweep cycle detector to handle these cycles, but I haven't written this for pht (and I don't really plan to, in the interest of simplicity). So if you do something like the following in pht:
$queue = newQueue();
$queue->push($queue);
Then this will leak, since the extension handles garbage collection of these object across threads (so it avoids using PHP's garbage collection mechanism).
Due to the simplicity of the data structures, I don't see any strong reasons as to why cyclic referencing would be needed anyway.
The README states "cyclic references will leak" in the data structure section. Can you detail this further?
The text was updated successfully, but these errors were encountered: