add optional SK_OVERRIDE_GLOBAL_NEW for testing

git-svn-id: http://skia.googlecode.com/svn/trunk@2217 2bbb7eff-a529-9590-31e7-b0007b416f81
This commit is contained in:
reed@google.com 2011-09-06 14:56:20 +00:00
parent 4fd0fb0b03
commit bdf736133b

View File

@ -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