WiiFlow_Lite/source/memory/smartalloc.cpp
fix94.1 f29a014ac0 -cleaned up mem allocs a bit, also corrected wrong display of
usable size in mem1 region, also fixed a fatal bug in it,
some bug is still in it...
2012-05-18 16:55:04 +00:00

23 lines
494 B
C++

#include "smartptr.hpp"
SmartBuf smartMemAlign32(unsigned int size)
{
return smartAnyAlloc(size);
}
SmartBuf smartMem2Alloc(unsigned int size)
{
return SmartBuf((unsigned char *)MEM2_alloc(size), SmartBuf::SRCALL_MEM2);
}
SmartBuf smartMem1Alloc(unsigned int size)
{
return SmartBuf((unsigned char *)MEM1_alloc(size), SmartBuf::SRCALL_MEM1);
}
SmartBuf smartAnyAlloc(unsigned int size)
{
SmartBuf p(smartMem2Alloc(size));
return !!p ? p : smartMem1Alloc(size);
}