POV-Ray : Newsgroups : povray.off-topic : Trolltech doesn't know how amortized time works : Re: Trolltech doesn't know how amortized time works Server Time
4 Sep 2024 21:18:21 EDT (-0400)
  Re: Trolltech doesn't know how amortized time works  
From: Kevin Wampler
Date: 2 Nov 2009 18:21:47
Message: <4aef698b$1@news.povray.org>
Darren New wrote:
> (assuming you're copying elements from the old array 
> to the new array each time, of course).

They do seem to actually address exactly this assumption with respect to 
their resizing scheme:

"This makes sense because modern operating systems don't copy the entire 
data when reallocating a buffer; the physical memory pages are simply 
reordered, and only the data on the first and last pages actually needs 
to be copied"

In fact, they explicitly address this difference with respect to QVector:

"Since the cost of reallocating is higher in that case, QVector<T> 
reduces the number of reallocations by always doubling the memory when 
running out of space."


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.