Unify PS2 and non-PS2 alloc code in Common::Array code (if this causes regressions somewhere, we better find a fix that also works on PS2)

svn-id: r42455
This commit is contained in:
Max Horn 2009-07-13 22:08:56 +00:00
parent 51a9bfc9e2
commit 3ed4f388d7

View File

@ -222,13 +222,7 @@ public:
T *old_storage = _storage;
_capacity = newCapacity;
// PS2 gcc 3.2.2 can't do "new T[newCapacity]()" but only
// "new T[newCapacity]" -> quick fix until we update tools.
#ifndef __PLAYSTATION2__
_storage = new T[newCapacity]();
#else
_storage = new T[newCapacity];
#endif
assert(_storage);
if (old_storage) {
@ -279,13 +273,7 @@ protected:
// If there is not enough space, allocate more and
// copy old elements over.
uint newCapacity = roundUpCapacity(_size + n);
// PS2 gcc 3.2.2 can't do "new T[newCapacity]()" but only
// "new T[newCapacity]" -> quick fix until we update tools.
#ifndef __PLAYSTATION2__
newStorage = new T[newCapacity]();
#else
newStorage = new T[newCapacity];
#endif
assert(newStorage);
copy(_storage, _storage + idx, newStorage);
pos = newStorage + idx;