diff options
-rw-r--r-- | include/core/SkTypes.h | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/include/core/SkTypes.h b/include/core/SkTypes.h index b38d4d016c..37e64e997c 100644 --- a/include/core/SkTypes.h +++ b/include/core/SkTypes.h @@ -69,7 +69,21 @@ static inline void sk_bzero(void* buffer, size_t size) { memset(buffer, 0, size); } -/////////////////////////////////////////////////////////////////////// +/////////////////////////////////////////////////////////////////////////////// + +#ifdef SK_OVERRIDE_GLOBAL_NEW +#include <new> + +inline void* operator new(size_t size) { + return sk_malloc_throw(size); +} + +inline void operator delete(void* p) { + sk_free(p); +} +#endif + +/////////////////////////////////////////////////////////////////////////////// #define SK_INIT_TO_AVOID_WARNING = 0 |