/*---------------------------------------------------------------------------* Project: Horizon File: Allocator.cpp 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: 47228 $ *---------------------------------------------------------------------------*/ /* *------------------------------------------------------------ * Copyright(c) 2009-2010 by Digital Media Professionals Inc. * All rights reserved. *------------------------------------------------------------ * This source code is the confidential and proprietary * of Digital Media Professionals Inc. *------------------------------------------------------------ */ #include #include "Allocator.h" static nn::fnd::ExpHeap s_ExpHeap; static bool s_Initialized = false; void setMemoryHeap(const uptr addr, const size_t size) { s_ExpHeap.Initialize(addr, size ); s_Initialized = true; } void* stdAlloc(int size) { if (!s_Initialized) return NULL; return s_ExpHeap.Allocate(size); } void stdFree(void* ptr) { if (!s_Initialized) return; s_ExpHeap.Free(ptr); return; }