[Scummvm-devel] Bugs blocking the DS port: SAGA Engine font loading crash, Options menus crash, GMM load/save crash

Max Horn max at quendi.de
Mon May 16 13:48:26 CEST 2011


Am 16.05.2011 um 12:18 schrieb A. Milburn:
[...]
> 
> P.S. Any objections to getting rid of the crazy +32 entirely? Arrays
> forcibly growing every time you make a copy is not very friendly.
> 

First off, you raise a valid point. No, we should not do
  _capacity = _size + 32;
in operator= -- instead it should do what the copy constructor already does, i.e.
  _capacity = _size;

But I have to nitpick a little bit on this one: It is not true that the array grows by 32 *every time* you copy it. It is true that the *capacity* is always set to be "_size + 32" when you copy an. But neither is that accumulative, nor does it necessarily mean the copy has a bigger capacity to the original; indeed, it is hypothetically possible that the original array had a capacity of say "_size + 1000".

Alas, this is just nitpicking, it doesn't change that the core of what you say is completely on spot :)


Cheers,
Max



More information about the Scummvm-devel mailing list