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

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

Issue 1620333002: Revert of Consolidate SK_CRASH and sk_throw into SK_ABORT (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 11 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 | « src/ports/SkMemory_malloc.cpp ('k') | src/ports/SkTypeface_win_dw.h » ('j') | 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 * Copyright 2012 Mozilla Foundation 3 * Copyright 2012 Mozilla Foundation
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 8
9 #include "SkTypes.h" 9 #include "SkTypes.h"
10 10
11 #include "mozilla/mozalloc.h" 11 #include "mozilla/mozalloc.h"
12 #include "mozilla/mozalloc_abort.h" 12 #include "mozilla/mozalloc_abort.h"
13 #include "mozilla/mozalloc_oom.h" 13 #include "mozilla/mozalloc_oom.h"
14 14
15 void sk_abort_no_print() { 15 void sk_throw() {
16 mozalloc_abort("Abort from sk_abort"); 16 SkDEBUGFAIL("sk_throw");
17 mozalloc_abort("Abort from sk_throw");
17 } 18 }
18 19
19 void sk_out_of_memory(void) { 20 void sk_out_of_memory(void) {
20 SkDEBUGFAIL("sk_out_of_memory"); 21 SkDEBUGFAIL("sk_out_of_memory");
21 mozalloc_handle_oom(0); 22 mozalloc_handle_oom(0);
22 } 23 }
23 24
24 void* sk_malloc_throw(size_t size) { 25 void* sk_malloc_throw(size_t size) {
25 return sk_malloc_flags(size, SK_MALLOC_THROW); 26 return sk_malloc_flags(size, SK_MALLOC_THROW);
26 } 27 }
(...skipping 10 matching lines...) Expand all
37 return (flags & SK_MALLOC_THROW) ? moz_xmalloc(size) : malloc(size); 38 return (flags & SK_MALLOC_THROW) ? moz_xmalloc(size) : malloc(size);
38 } 39 }
39 40
40 void* sk_calloc(size_t size) { 41 void* sk_calloc(size_t size) {
41 return calloc(size, 1); 42 return calloc(size, 1);
42 } 43 }
43 44
44 void* sk_calloc_throw(size_t size) { 45 void* sk_calloc_throw(size_t size) {
45 return moz_xcalloc(size, 1); 46 return moz_xcalloc(size, 1);
46 } 47 }
OLDNEW
« no previous file with comments | « src/ports/SkMemory_malloc.cpp ('k') | src/ports/SkTypeface_win_dw.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698