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

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

Issue 15941025: Add SkData::NewFromFD. (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Remove an indentation level. Created 7 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « src/ports/SkDebug_brew.cpp ('k') | src/ports/SkOSFile_brew.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 /* libs/graphics/ports/SkMemory_brew.cpp
2 *
3 * Copyright 2009, The Android Open Source Project
4 * Copyright 2009, Company 100, Inc.
5 *
6 * Use of this source code is governed by a BSD-style license that can be
7 * found in the LICENSE file.
8 */
9
10 #include "SkTypes.h"
11
12 #ifdef SK_BUILD_FOR_BREW
13
14 #include <AEEStdLib.h>
15
16 void sk_throw() {
17 SkDEBUGFAIL("sk_throw");
18 abort();
19 }
20
21 void sk_out_of_memory(void) {
22 SkDEBUGFAIL("sk_out_of_memory");
23 abort();
24 }
25
26 void* sk_malloc_throw(size_t size) {
27 return sk_malloc_flags(size, SK_MALLOC_THROW);
28 }
29
30 void* sk_realloc_throw(void* addr, size_t size) {
31 void* p = REALLOC(addr, size | ALLOC_NO_ZMEM);
32 if (size == 0) {
33 return p;
34 }
35 if (p == NULL) {
36 sk_throw();
37 }
38 return p;
39 }
40
41 void sk_free(void* p) {
42 FREEIF(p);
43 }
44
45 void* sk_malloc_flags(size_t size, unsigned flags) {
46 void* p = MALLOC(size | ALLOC_NO_ZMEM);
47 if (p == NULL) {
48 if (flags & SK_MALLOC_THROW) {
49 sk_throw();
50 }
51 }
52 return p;
53 }
54
55 #endif
OLDNEW
« no previous file with comments | « src/ports/SkDebug_brew.cpp ('k') | src/ports/SkOSFile_brew.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698