Reorganize includes to match asm

Former-commit-id: 848752477e
This commit is contained in:
2022-07-18 18:42:58 -04:00
parent 6a471a6abe
commit bed1bb88de
56 changed files with 93 additions and 98 deletions

View File

@@ -0,0 +1,27 @@
#ifndef _TONESTATIC_HPP
#define _TONESTATIC_HPP
#include "types.h"
template < typename T >
class TOneStatic {
public:
void* operator new(unsigned long sz, const char*, const char*); /* {
ReferenceCount()++;
return GetAllocSpace();
}*/
void* operator new(unsigned long sz) { return operator new(sz, "??(??)", nullptr); }
void operator delete(void* ptr) { ReferenceCount()--; }
private:
static void* GetAllocSpace() {
static u8 sAllocSpace[sizeof(T)];
return &sAllocSpace;
}
static u32& ReferenceCount() {
static u32 sReferenceCount = 0;
return sReferenceCount;
}
};
#endif