metaforce/Runtime/CGameAllocator.cpp

27 lines
524 B
C++
Raw Normal View History

#include "Runtime/CGameAllocator.hpp"
2020-09-08 17:58:55 +00:00
#include <new>
2021-04-10 08:42:06 +00:00
namespace metaforce {
logvisor::Module AllocLog("metaforce::CGameAllocator");
#pragma GCC diagnostic ignored "-Wclass-memaccess"
2020-09-08 17:58:55 +00:00
u32 CGameAllocator::GetFreeBinEntryForSize(size_t len) {
size_t bin = 0;
size_t binSize = 32;
while (true) {
if (binSize > 0x200000) {
return 15;
}
if (len < binSize) {
break;
}
2020-09-08 17:58:55 +00:00
binSize <<= 1;
++bin;
2018-12-08 05:30:43 +00:00
}
2020-09-08 17:58:55 +00:00
return bin;
}
2020-09-08 17:58:55 +00:00
bool CGameAllocator::Initialize() { return true; }
2021-04-10 08:42:06 +00:00
} // namespace metaforce