Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(508)

Side by Side Diff: src/ports/SkMemory_malloc.cpp

Issue 2161103002: Improve assert reporting. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Address comments. Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « include/core/SkTypes.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « include/core/SkTypes.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698