/*---------------------------------------------------------------------------* Project: Horizon File: HeapManager.h Copyright 2009 Nintendo. 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$ *---------------------------------------------------------------------------*/ #ifndef HEAPMANAGER_H_ #define HEAPMANAGER_H_ #include #include class HeapManager { public: explicit HeapManager(size_t byteSize, s32 alignment = nn::fnd::ExpHeapBase::DEFAULT_ALIGNMENT, bit8 groupId = 0, nn::fnd::ExpHeapBase::AllocationMode mode = nn::fnd::ExpHeapBase::ALLOCATION_MODE_FIRST_FIT, bool reuse = false); virtual ~HeapManager(); void* GetAddr(); private: void* m_Ptr; }; void InitializeHeap(); size_t GetAllocatableSize(s32 alignment = nn::fnd::ExpHeapBase::DEFAULT_ALIGNMENT); // HeapManagerを使わず確保する場合のみ void* ForceAllocate(size_t byteSize, s32 alignment = nn::fnd::ExpHeapBase::DEFAULT_ALIGNMENT, bit8 groupId = 0, nn::fnd::ExpHeapBase::AllocationMode mode = nn::fnd::ExpHeapBase::ALLOCATION_MODE_FIRST_FIT, bool reuse = false); // HeapManagerを使わず解放する場合のみ void ForceFree(void* ptr); #endif /* HEAPMANAGER_H_ */