| OLD | NEW |
| 1 #include "SkTypes.h" | |
| 2 #include <stdio.h> | 1 #include <stdio.h> |
| 3 #include <stdlib.h> | 2 #include <stdlib.h> |
| 4 #include <new> | 3 #include <new> |
| 5 | 4 |
| 5 #include "third_party/skia/include/core/SkTypes.h" |
| 6 |
| 6 // This implementation of sk_malloc_flags() and friends is identical | 7 // This implementation of sk_malloc_flags() and friends is identical |
| 7 // to SkMemory_malloc.c, except that it disables the CRT's new_handler | 8 // to SkMemory_malloc.c, except that it disables the CRT's new_handler |
| 8 // during malloc(), when SK_MALLOC_THROW is not set (ie., when | 9 // during malloc(), when SK_MALLOC_THROW is not set (ie., when |
| 9 // sk_malloc_flags() would not abort on NULL). | 10 // sk_malloc_flags() would not abort on NULL). |
| 10 | 11 |
| 11 void sk_throw() { | 12 void sk_throw() { |
| 12 SkASSERT(!"sk_throw"); | 13 SkASSERT(!"sk_throw"); |
| 13 abort(); | 14 abort(); |
| 14 } | 15 } |
| 15 | 16 |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 std::set_new_handler(old_handler); | 50 std::set_new_handler(old_handler); |
| 50 } | 51 } |
| 51 if (p == NULL) { | 52 if (p == NULL) { |
| 52 if (flags & SK_MALLOC_THROW) { | 53 if (flags & SK_MALLOC_THROW) { |
| 53 sk_throw(); | 54 sk_throw(); |
| 54 } | 55 } |
| 55 } | 56 } |
| 56 return p; | 57 return p; |
| 57 } | 58 } |
| 58 | 59 |
| OLD | NEW |