caudio/cAudio/include/cAudioMemory.h
Murat Suri f3cee669d5 * Use "#pragma once" instead ordinary include guards
* Remove redundant mutex locking in DecoderFactories (the access is already locked by the callee)
2011-05-29 18:33:24 +00:00

24 lines
850 B
C++

#pragma once
#include "cAudioDefines.h"
#include "IMemoryProvider.h"
#ifdef CAUDIO_DEBUG
#define CAUDIO_NEW new (__FILE__, __LINE__, __FUNCTION__)
#define CAUDIO_DELETE delete
#define CAUDIO_MALLOC(size) cAudio::getMemoryProvider()->Allocate(size, __FILE__, __LINE__, __FUNCTION__)
#define CAUDIO_FREE(pointer) cAudio::getMemoryProvider()->Free((void*)pointer)
#else
#define CAUDIO_NEW new
#define CAUDIO_DELETE delete
#define CAUDIO_MALLOC(size) cAudio::getMemoryProvider()->Allocate(size, NULL, -1, NULL)
#define CAUDIO_FREE(pointer) cAudio::getMemoryProvider()->Free((void*)pointer)
#endif
namespace cAudio
{
//! Returns a pointer to the memory provider of cAudio
/** Used by cAudio for all allocations of memory
\return A pointer to the memory provider */
CAUDIO_API IMemoryProvider* getMemoryProvider();
};