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

Side by Side Diff: include/core/SkTypes.h

Issue 377113004: sk_malloc_throw/sk_calloc_throw in debug prints size in failure message (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: mtkein suggestions. Created 6 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 | « no previous file | src/ports/SkMemory_malloc.cpp » ('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 2006 The Android Open Source Project 2 * Copyright 2006 The Android Open Source Project
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 #ifndef SkTypes_DEFINED 8 #ifndef SkTypes_DEFINED
9 #define SkTypes_DEFINED 9 #define SkTypes_DEFINED
10 10
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 #define SkAssertResult(cond) cond 113 #define SkAssertResult(cond) cond
114 #endif 114 #endif
115 115
116 #define SkFAIL(message) SK_ALWAYSBREAK(false && message) 116 #define SkFAIL(message) SK_ALWAYSBREAK(false && message)
117 117
118 // We want to evaluate cond only once, and inside the SkASSERT somewhere so we s ee its string form. 118 // We want to evaluate cond only once, and inside the SkASSERT somewhere so we s ee its string form.
119 // So we use the comma operator to make an SkDebugf that always returns false: w e'll evaluate cond, 119 // So we use the comma operator to make an SkDebugf that always returns false: w e'll evaluate cond,
120 // and if it's true the assert passes; if it's false, we'll print the message an d the assert fails. 120 // and if it's true the assert passes; if it's false, we'll print the message an d the assert fails.
121 #define SkASSERTF(cond, fmt, ...) SkASSERT((cond) || (SkDebugf(fmt"\n", __ VA_ARGS__), false)) 121 #define SkASSERTF(cond, fmt, ...) SkASSERT((cond) || (SkDebugf(fmt"\n", __ VA_ARGS__), false))
122 122
123 #define SK_DEBUGFAILF(fmt, ...) SkASSERT((SkDebugf(fmt"\n", __VA_ARGS__) , false))
reed1 2014/07/10 15:42:22 Lets just place this at the one callsite in your i
124
123 #ifdef SK_DEVELOPER 125 #ifdef SK_DEVELOPER
124 #define SkDEVCODE(code) code 126 #define SkDEVCODE(code) code
125 #else 127 #else
126 #define SkDEVCODE(code) 128 #define SkDEVCODE(code)
127 #endif 129 #endif
128 130
129 #ifdef SK_IGNORE_TO_STRING 131 #ifdef SK_IGNORE_TO_STRING
130 #define SK_TO_STRING_NONVIRT() 132 #define SK_TO_STRING_NONVIRT()
131 #define SK_TO_STRING_VIRT() 133 #define SK_TO_STRING_VIRT()
132 #define SK_TO_STRING_PUREVIRT() 134 #define SK_TO_STRING_PUREVIRT()
(...skipping 529 matching lines...) Expand 10 before | Expand all | Expand 10 after
662 private: 664 private:
663 void* fPtr; 665 void* fPtr;
664 size_t fSize; // can be larger than the requested size (see kReuse) 666 size_t fSize; // can be larger than the requested size (see kReuse)
665 uint32_t fStorage[(kSize + 3) >> 2]; 667 uint32_t fStorage[(kSize + 3) >> 2];
666 }; 668 };
667 // Can't guard the constructor because it's a template class. 669 // Can't guard the constructor because it's a template class.
668 670
669 #endif /* C++ */ 671 #endif /* C++ */
670 672
671 #endif 673 #endif
OLDNEW
« no previous file with comments | « no previous file | src/ports/SkMemory_malloc.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698