This commit is contained in:
Li XianJing 2018-07-03 10:17:16 +08:00
parent 9c284dd144
commit fc79e707a2

View File

@ -4,17 +4,19 @@
#ifndef HAS_STD_MALLOC
void* operator new(std::size_t size) throw(std::bad_alloc) {
void* operator new(std::size_t size) {
if (size >= MAX_SIZE) {
size = size;
throw std::bad_alloc();
}
return TKMEM_ALLOC(size);
}
void* operator new[](std::size_t size) throw(std::bad_alloc) {
void* operator new[](std::size_t size) {
if (size >= MAX_SIZE) {
size = size;
throw std::bad_alloc();
}
return TKMEM_ALLOC(size);