mirror of
https://github.com/Fledge68/WiiFlow_Lite.git
synced 2024-12-17 23:41:53 +01:00
28 lines
618 B
C++
28 lines
618 B
C++
|
#include "smartptr.hpp"
|
||
|
|
||
|
SmartBuf smartMalloc(unsigned int size)
|
||
|
{
|
||
|
return SmartBuf((unsigned char *)malloc(size), SmartBuf::SRCALL_MALLOC);
|
||
|
}
|
||
|
|
||
|
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);
|
||
|
}
|