Quote from: eri0o on Tue 18/04/2023 21:40:01I don't think I get quite well what circular dependency case you mean here, can you explain it with some example?
Simply when two objects reference each other, directly or indirectly.
// Example 1
struct LinkedItem {
LinkedItem* next;
LinkedItem* prev;
};
// Example 2
struct Parent {
Child* children[];
};
struct Child {
Parent* parent;
};
Quote from: eri0o on Tue 18/04/2023 21:40:01QuoteSupposing we only run GC between the scripts, during the game frame update
Would the GC not need to happen on each scope change? Or would this only affect the circular dependent object?
What is "scope change"?
GC does not have a strict requirement to happen on particular events, it's okay to run it periodically.
It may be run by a timer, or under some trigger conditions based on managed pool statistics.
It also may be run on a separate thread, but only during some script-unrelated processes, like render or game update, that do not make any immediate script runs.