helos1/memory/memory_cpp.cpp

14 lines
215 B
C++
Raw Normal View History

2021-10-10 14:39:17 +08:00
#include "memory.hpp"
void *operator new(std::size_t size) {
void *data = kMalloc(size);
/*if (!data) {
throw helos::bad_alloc();
}*/
return data;
}
void operator delete(void *ptr) noexcept {
kFree(ptr);
}