Browse Source

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

Darryl Pogue 13 years ago committed by Adam Johnson
parent
commit
b3f75a5ae7
  1. 3
      Sources/Plasma/CoreLib/hsMalloc.h
  2. 2
      Sources/Plasma/NucleusLib/pnUtils/Private/pnUtArray.h

3
Sources/Plasma/CoreLib/hsMalloc.h

@ -167,9 +167,6 @@ inline void CDECL operator delete (void *, void *) {}
#define ALLOC(b) MemAlloc(b, 0, __FILE__, __LINE__) #define ALLOC(b) MemAlloc(b, 0, __FILE__, __LINE__)
#define ALLOCZERO(b) MemAlloc(b, kMemZero, __FILE__, __LINE__) #define ALLOCZERO(b) MemAlloc(b, kMemZero, __FILE__, __LINE__)
#define ALLOCFLAGS(b, f) MemAlloc(b, (f), __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 MEMDUP(s, b) MemDup(s, b, 0, __FILE__, __LINE__)
#define ZERO(s) MemSet(&s, 0, sizeof(s)) #define ZERO(s) MemSet(&s, 0, sizeof(s))
#define ZEROPTR(p) MemSet(p, 0, sizeof(*p)) #define ZEROPTR(p) MemSet(p, 0, sizeof(*p))

2
Sources/Plasma/NucleusLib/pnUtils/Private/pnUtArray.h

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

Loading…
Cancel
Save