mirror of
https://github.com/libretro/scummvm.git
synced 2024-12-04 08:17:40 +00:00
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:
parent
51a9bfc9e2
commit
3ed4f388d7
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user