mirror of
https://gitee.com/zlgopen/awtk.git
synced 2024-11-30 19:18:53 +08:00
fix new
This commit is contained in:
parent
9c284dd144
commit
fc79e707a2
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user