/*---------------------------------------------------------------------------* Project: Horizon File: MemoryManager.h Copyright (C)2009-2012 Nintendo Co., Ltd. All rights reserved. These coded instructions, statements, and computer programs contain proprietary information of Nintendo of America Inc. and/or Nintendo Company Ltd., and are protected by Federal copyright law. They may not be disclosed to third parties or copied or duplicated in any form, in whole or in part, without the prior written consent of Nintendo. $Rev: 46365 $ *---------------------------------------------------------------------------*/ #ifndef MEMORY_MANAGER_H_ #define MEMORY_MANAGER_H_ #include namespace demo { namespace memory_manager { namespace detail { /* Please see man pages for details */ class MemoryManager : private nn::util::NonCopyable { public: /* Please see man pages for details */ MemoryManager(void); /* Please see man pages for details */ virtual ~MemoryManager(); /* Please see man pages for details */ void Initialize(const uptr fcramAddress, const size_t memorySize); /* Please see man pages for details */ void Finalize(void); /* Please see man pages for details */ void* Allocate(GLenum area, GLenum aim, GLuint id, GLsizei size); /* Please see man pages for details */ void Deallocate(GLenum area, GLenum aim, GLuint id, void* addr); /* Please see man pages for details */ void PrintFreeMemorySize(void); private: bool m_Initialized; u8 m_Pad[3]; uptr m_pStartAddrFcram; uptr m_CurrentAddrVramA; uptr m_CurrentAddrVramB; nn::fnd::ExpHeap m_HeapOnFcram; size_t m_AllocatedBlockSize; public: bool m_DebugPrint; NN_PADDING3; }; } // namespace detail /* Please see man pages for details */ void InitializeMemoryManager(const uptr fcramAddress, const size_t memorySize); /* Please see man pages for details */ void FinalizeMemoryManager(void); /* Please see man pages for details */ void PrintMemoryManagerInfo(void); /* Please see man pages for details */ void* GetAllocator(GLenum area, GLenum aim, GLuint id, GLsizei size); /* Please see man pages for details */ void GetDeallocator(GLenum area, GLenum aim, GLuint id, void* addr); /* Please see man pages for details */ void* Alloc(size_t size); void* Alloc(GLenum aim, const size_t size); void* Alloc(GLenum area, GLenum aim, const size_t size); /* Please see man pages for details */ void Free(void* ptr); } } #endif