version 1.22, 2006/01/30 16:17:05
|
version 1.23, 2006/07/12 21:10:58
|
|
|
template<class T> | template<class T> |
inline void Destroy(T* items, Uint32 size) | inline void Destroy(T* items, Uint32 size) |
{ | { |
|
#ifdef PEGASUS_OS_HPUX |
|
// Empirical evidence shows that the memory allocator on HP-UX performs |
|
// better when deallocating more recently allocated memory first (LIFO). |
|
// Since most arrays are built up by appending elements to the end, it is |
|
// advantageous to destruct the elements in reverse order. |
|
items += size-1; |
|
while (size--) |
|
(items--)->~T(); |
|
#else |
while (size--) | while (size--) |
items++->~T(); | items++->~T(); |
|
#endif |
} | } |
| |
template<class T> | template<class T> |