2
3
mirror of https://foundry.openuru.org/gitblit/r/CWE-ou-minkata.git synced 2025-07-14 10:37:41 -04:00

Get rid of REALLOC(), REALLOCFLAGS(), and CALLOC()

This commit is contained in:
Darryl Pogue
2011-10-23 23:10:15 -07:00
committed by Adam Johnson
parent 48b8cd8ad0
commit b3f75a5ae7
2 changed files with 1 additions and 4 deletions

View File

@ -167,9 +167,6 @@ inline void CDECL operator delete (void *, void *) {}
#define ALLOC(b) MemAlloc(b, 0, __FILE__, __LINE__)
#define ALLOCZERO(b) MemAlloc(b, kMemZero, __FILE__, __LINE__)
#define ALLOCFLAGS(b, f) MemAlloc(b, (f), __FILE__, __LINE__)
#define REALLOC(p, b) MemRealloc(p, b, 0, __FILE__, __LINE__)
#define REALLOCFLAGS(p, b, f) MemRealloc(p, b, (f), __FILE__, __LINE__)
#define CALLOC(n, s) MemAlloc((n)*(s), kMemZero, __FILE__, __LINE__)
#define MEMDUP(s, b) MemDup(s, b, 0, __FILE__, __LINE__)
#define ZERO(s) MemSet(&s, 0, sizeof(s))
#define ZEROPTR(p) MemSet(p, 0, sizeof(*p))

View File

@ -245,7 +245,7 @@ void TBuffer<T>::Set (const T * source, unsigned count) {
template<class T>
void TBuffer<T>::SetBytes (unsigned bytes) {
if (bytes)
m_data = (T *)REALLOCFLAGS(m_data, bytes, ARR_MEMORY_FLAGS);
m_data = (T *)realloc(m_data, bytes);
else if (m_data) {
free(m_data);
m_data = nil;