| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2011 Google Inc. | 2 * Copyright 2011 Google Inc. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
| 5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
| 6 */ | 6 */ |
| 7 | 7 |
| 8 #include "SkTypes.h" | 8 #include "SkTypes.h" |
| 9 | 9 |
| 10 #include <stdlib.h> | 10 #include <stdlib.h> |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 sk_out_of_memory(size); | 24 sk_out_of_memory(size); |
| 25 } | 25 } |
| 26 return p; | 26 return p; |
| 27 } | 27 } |
| 28 | 28 |
| 29 void sk_abort_no_print() { | 29 void sk_abort_no_print() { |
| 30 #if defined(SK_BUILD_FOR_WIN) && defined(SK_IS_BOT) | 30 #if defined(SK_BUILD_FOR_WIN) && defined(SK_IS_BOT) |
| 31 // do not display a system dialog before aborting the process | 31 // do not display a system dialog before aborting the process |
| 32 _set_abort_behavior(0, _WRITE_ABORT_MSG); | 32 _set_abort_behavior(0, _WRITE_ABORT_MSG); |
| 33 #endif | 33 #endif |
| 34 #if defined(SK_DEBUG) && defined(SK_BUILD_FOR_WIN) |
| 35 __debugbreak(); |
| 36 #else |
| 34 abort(); | 37 abort(); |
| 38 #endif |
| 35 } | 39 } |
| 36 | 40 |
| 37 void sk_out_of_memory(void) { | 41 void sk_out_of_memory(void) { |
| 38 SkDEBUGFAIL("sk_out_of_memory"); | 42 SkDEBUGFAIL("sk_out_of_memory"); |
| 39 abort(); | 43 abort(); |
| 40 } | 44 } |
| 41 | 45 |
| 42 void* sk_malloc_throw(size_t size) { | 46 void* sk_malloc_throw(size_t size) { |
| 43 return sk_malloc_flags(size, SK_MALLOC_THROW); | 47 return sk_malloc_flags(size, SK_MALLOC_THROW); |
| 44 } | 48 } |
| (...skipping 17 matching lines...) Expand all Loading... |
| 62 } | 66 } |
| 63 } | 67 } |
| 64 | 68 |
| 65 void* sk_calloc(size_t size) { | 69 void* sk_calloc(size_t size) { |
| 66 return calloc(size, 1); | 70 return calloc(size, 1); |
| 67 } | 71 } |
| 68 | 72 |
| 69 void* sk_calloc_throw(size_t size) { | 73 void* sk_calloc_throw(size_t size) { |
| 70 return throw_on_failure(size, sk_calloc(size)); | 74 return throw_on_failure(size, sk_calloc(size)); |
| 71 } | 75 } |
| OLD | NEW |