mirror of
https://github.com/topjohnwu/Magisk.git
synced 2025-01-04 03:37:38 +00:00
15 lines
685 B
C++
15 lines
685 B
C++
#include <new>
|
|
#include <cstdlib>
|
|
|
|
/* Override libc++ new implementation
|
|
* to optimize final build size */
|
|
|
|
void* operator new(std::size_t s) { return std::malloc(s); }
|
|
void* operator new[](std::size_t s) { return std::malloc(s); }
|
|
void operator delete(void *p) { std::free(p); }
|
|
void operator delete[](void *p) { std::free(p); }
|
|
void* operator new(std::size_t s, const std::nothrow_t&) noexcept { return std::malloc(s); }
|
|
void* operator new[](std::size_t s, const std::nothrow_t&) noexcept { return std::malloc(s); }
|
|
void operator delete(void *p, const std::nothrow_t&) noexcept { std::free(p); }
|
|
void operator delete[](void *p, const std::nothrow_t&) noexcept { std::free(p); }
|