2015-08-17 05:26:58 +00:00
|
|
|
#ifndef __RETRO_CMEMORY_HPP__
|
|
|
|
#define __RETRO_CMEMORY_HPP__
|
|
|
|
|
2015-08-23 18:53:43 +00:00
|
|
|
#include "IAllocator.hpp"
|
|
|
|
|
2015-08-17 22:05:00 +00:00
|
|
|
namespace Retro
|
|
|
|
{
|
2015-08-22 01:58:41 +00:00
|
|
|
class COsContext;
|
2015-08-17 22:05:00 +00:00
|
|
|
|
2015-08-17 05:26:58 +00:00
|
|
|
class CMemory
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
static void Startup(COsContext&);
|
|
|
|
static void Shutdown();
|
|
|
|
static void SetAllocator(COsContext&, IAllocator&);
|
2015-08-23 18:53:43 +00:00
|
|
|
static void OffsetFakeStatics(int);
|
|
|
|
static void SetOutOfMemoryCallback(const IAllocator::TOutOfMemoryCallback, void*);
|
|
|
|
static void Free(void*);
|
2015-08-23 23:58:07 +00:00
|
|
|
static void* Alloc(size_t, IAllocator::EHint, IAllocator::EScope, IAllocator::EType, const CCallStack&);
|
2015-08-17 05:26:58 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
class CMemorySys
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
CMemorySys(COsContext&, IAllocator&);
|
|
|
|
~CMemorySys();
|
2015-08-17 20:33:58 +00:00
|
|
|
static IAllocator& GetGameAllocator();
|
2015-08-17 05:26:58 +00:00
|
|
|
};
|
|
|
|
|
2015-08-17 22:05:00 +00:00
|
|
|
}
|
|
|
|
|
2015-08-23 23:58:07 +00:00
|
|
|
/* Custom new funcs */
|
|
|
|
void* operator new(std::size_t sz, const char* funcName, const char* typeName);
|
|
|
|
void* operator new[](std::size_t sz, const char* funcName, const char* typeName);
|
|
|
|
|
2015-08-17 05:26:58 +00:00
|
|
|
#endif // __RETRO_CMEMORY_HPP__
|