Index: src/ports/SkMemory_malloc.cpp |
diff --git a/src/ports/SkMemory_malloc.cpp b/src/ports/SkMemory_malloc.cpp |
index 3a5608ef15b40e7514276b5dfc94e8fa8fb7a497..0b936c9f8cdd3249bd680609b5f630d56c01cfb8 100644 |
--- a/src/ports/SkMemory_malloc.cpp |
+++ b/src/ports/SkMemory_malloc.cpp |
@@ -9,10 +9,19 @@ |
#include <stdio.h> |
#include <stdlib.h> |
+#define SK_DEBUGFAILF(fmt, ...) \ |
+ SkASSERT((SkDebugf(fmt"\n", __VA_ARGS__), false)) |
+ |
+static inline void sk_out_of_memory(size_t size) { |
+ SK_DEBUGFAILF("sk_out_of_memory (asked for " SK_SIZE_T_SPECIFIER " bytes)", |
+ size); |
+ abort(); |
+} |
+ |
static inline void* throw_on_failure(size_t size, void* p) { |
if (size > 0 && p == NULL) { |
// If we've got a NULL here, the only reason we should have failed is running out of RAM. |
- sk_out_of_memory(); |
+ sk_out_of_memory(size); |
} |
return p; |
} |