metaforce/Runtime/CMemory.hpp

41 lines
870 B
C++
Raw Normal View History

2016-04-13 06:07:23 +00:00
#ifndef __URDE_CMEMORY_HPP__
#define __URDE_CMEMORY_HPP__
2015-08-17 05:26:58 +00:00
2016-04-15 20:42:40 +00:00
#if 0
2015-08-23 18:53:43 +00:00
#include "IAllocator.hpp"
2016-03-04 23:04:53 +00:00
namespace urde
{
2015-08-22 01:58:41 +00:00
class COsContext;
2015-08-17 05:26:58 +00:00
class CMemory
{
public:
2015-08-28 00:11:31 +00:00
static void Startup();
2015-08-17 05:26:58 +00:00
static void Shutdown();
2015-08-28 00:11:31 +00:00
static void SetAllocator(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:
2015-08-28 00:11:31 +00:00
CMemorySys(IAllocator&);
2015-08-17 05:26:58 +00:00
~CMemorySys();
2015-08-17 20:33:58 +00:00
static IAllocator& GetGameAllocator();
2015-08-17 05:26:58 +00:00
};
}
2015-08-23 23:58:07 +00:00
/* Custom new funcs */
2016-04-15 20:42:40 +00:00
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);
#endif
2015-08-23 23:58:07 +00:00
2016-04-13 06:07:23 +00:00
#endif // __URDE_CMEMORY_HPP__