Current solution of GC is to collect variables, but many temporary variables will be created when pushing something into Context. And each variable may contain a shared_ptr to one object, so the object won't be released until the variable is released.
So another plan is to collect objects instead of variables and use shared_ptr of variables, then variables could be released in real time. And objects would be released when GC.
Something different is that variables and objects will be released at the same time in the former one, but in the latter variables could be released before objects.
Current solution of GC is to collect variables, but many temporary variables will be created when pushing something into Context. And each variable may contain a shared_ptr to one object, so the object won't be released until the variable is released.
So another plan is to collect objects instead of variables and use shared_ptr of variables, then variables could be released in real time. And objects would be released when GC.
Something different is that variables and objects will be released at the same time in the former one, but in the latter variables could be released before objects.