| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 1 #include "SkTypes.h" | 5 #include "SkTypes.h" |
| 2 #include <stdio.h> | 6 #include <stdio.h> |
| 3 #include <stdlib.h> | 7 #include <stdlib.h> |
| 4 #include <new> | 8 #include <new> |
| 5 | 9 |
| 6 // This implementation of sk_malloc_flags() and friends is identical | 10 // This implementation of sk_malloc_flags() and friends is identical |
| 7 // to SkMemory_malloc.c, except that it disables the CRT's new_handler | 11 // 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 | 12 // during malloc(), when SK_MALLOC_THROW is not set (ie., when |
| 9 // sk_malloc_flags() would not abort on NULL). | 13 // sk_malloc_flags() would not abort on NULL). |
| 10 | 14 |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 std::set_new_handler(old_handler); | 53 std::set_new_handler(old_handler); |
| 50 } | 54 } |
| 51 if (p == NULL) { | 55 if (p == NULL) { |
| 52 if (flags & SK_MALLOC_THROW) { | 56 if (flags & SK_MALLOC_THROW) { |
| 53 sk_throw(); | 57 sk_throw(); |
| 54 } | 58 } |
| 55 } | 59 } |
| 56 return p; | 60 return p; |
| 57 } | 61 } |
| 58 | 62 |
| OLD | NEW |