[Development] HEADS UP: Don't use QList, use Q_DECLARE_TYPEINFO

Matthew Woehlke mwoehlke.floss at gmail.com
Mon Aug 10 16:54:38 CEST 2015


On 2015-08-09 21:58, Thiago Macieira wrote:
> On Monday 10 August 2015 02:36:20 Kevin Kofler wrote:
>> realloc doesn't work if you are inserting or removing in the middle of a
>> vector.
> 
> Sure it does. It's required if you need to insert anywhere but don't have 
> enough space.
> 
> Now, if you're not appending to the end, you'll need to memmove elements 
> around, sure. But that's a second step.

If you are doing both, isn't it more efficient to allocate and do two
partial memmove's rather than doing a realloc? (In the case that you
can't do an in-place realloc, that is...)

...that would require a try_realloc though...

-- 
Matthew




More information about the Development mailing list