prime/include/Kyoto/Alloc/CMemory.hpp
Luke Street bed1bb88de Reorganize includes to match asm
Former-commit-id: 848752477e6833629bb0ce30125ca6f5dbffccd1
2022-07-18 18:42:58 -04:00

29 lines
792 B
C++

#ifndef _CMEMORY_HPP
#define _CMEMORY_HPP
#include "types.h"
namespace CMemory {
void* Alloc(unsigned long sz);
void Free(const void* ptr);
} // namespace CMemory
void* operator new(unsigned long sz, const char*, const char*);
void* operator new[](unsigned long sz, const char*, const char*);
inline void* operator new(unsigned long sz) {
const char* fileAndLineNo = "??(??)";
const char* type = nullptr;
return operator new(sz, fileAndLineNo, type);
}
inline void* operator new[](unsigned long sz) {
const char* fileAndLineNo = "??(??)";
const char* type = nullptr;
return operator new[](sz, fileAndLineNo, type);
}
// placement new
inline void* operator new(unsigned long n, void* ptr) { return ptr; };
inline void operator delete(void* ptr) { CMemory::Free(ptr); }
#endif