[Development] Qt 5.9's new garbage collector documentation? + root_ptr

Phil Bouchard philippeb8 at gmail.com
Fri Jul 7 15:30:22 CEST 2017


Tim Blechmann <tim at klingt.org> wrote:
>> If there is one root_ptr per
>> Javascript function then all local variables are guaranteed to be
>> destroyed.  And closures aren't too big of a deal either because child
>> objects can easily refer to their parent.
>> 
>> But returning local variables might need some work on root_ptr such as
>> "unlisting" the variable from one set in order to "enlist" it to the
>> parent set.
> 
> how do you solve the situation that an object might be referenced by
> multiple roots?
> 

Please elaborate because as far as I know variables in Javascript have a
function scope and functions can be nested (waterfall parent-child
hierarchy). So child functions can access the parent variables because the
root_ptr of the child will be deleted before its parent.

Thus all I need to do is:
- add some implicit parameter to functions which will represent return
variables
- remove the ability of root_ptr from unifying with other sets


Thanks,
-Phil




More information about the Development mailing list