[Development] atomic reference counting implementation

Mutz, Marc marc at kdab.com
Sat Aug 10 14:47:25 CEST 2019


On 2019-08-10 15:41, Kevin Kofler wrote:
> Mutz, Marc via Development wrote:
>> But that's the whole point Olivier was making two years ago: ref() is
>> _documented_ to be a memory barrier:
>> 
>> https://doc.qt.io/qt-5/qatomicinteger.html#ref:
> 
> But QSharedDataPointer is NOT documented to call 
> QAtomicInteger::ref/deref,
> the documentation just talks about incrementing or decrementing 
> reference
> counts. So the exact method called is an implementation detail.
> 
> Hence, why can't we just add new QAtomicInteger::refRelaxed and
> QAtomicInteger::derefRelaxed methods and use those in 
> QSharedDataPointer
> instead of plain ref and deref? It is a drop-in replacement, introduces 
> no
> code duplication, and does not change any documented behavior.

I'd expect your patch to be duly considered, one you upload it.

Thanks,
Marc



More information about the Development mailing list