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

Phil Bouchard philippeb8 at gmail.com
Thu Jul 6 13:53:16 CEST 2017


On 07/06/2017 01:01 AM, Thiago Macieira wrote:
> On quarta-feira, 5 de julho de 2017 19:32:35 PDT Phil Bouchard wrote:
>> - Well with root_ptr the behavior is 100% predictable thus you won't
>> have these rendering lags at random times.
>
> So explain to me how the QML engine should collect JS items that have gone
> unused and unreferenced during the exection. Predictable execution isn't good
> enough if it involves never garbage collecting and thus using a lot more
> memory.

It's all memory usage and bad programming habits vs execution speed. 
Why would you want to add objects that are never used?  A minimum 
programming skills set is required here.  You're saying the actual 
garbage collector should compensate for programming errors when I'm 
saying that's the programmer's responsibility.

We want the fastest executable in the end given an extensible level of 
complexity of the executable.  If the garbage collector stops you from 
doing that then there's is no light at the end of the tunnel.

Or perhaps it should be a choice on whether the user wants to use the 
garbage collector or root_ptr and he can decide by himself what is more 
convenient for him according to his context.

>> - The objects are destroyed is the exact reverse order they were
>> constructed thus this will help debugging.
>
> But unnecessary, since the order they are constructed is irrelevant. The JS
> order matters.

It's a plus.


-Phil




More information about the Development mailing list