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

Unified Diff: skia/corecg/SkMemory_stdlib.cpp

Issue 100163: When skia ok's a NULL malloc, don't call __debugbreak. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/app/chrome_dll_main.cc ('k') | skia/include/corecg/SkTypes.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: skia/corecg/SkMemory_stdlib.cpp
===================================================================
--- skia/corecg/SkMemory_stdlib.cpp (revision 14854)
+++ skia/corecg/SkMemory_stdlib.cpp (working copy)
@@ -25,6 +25,8 @@
// #define SK_CHECK_TAGS // enable to double-check debugging link list
#endif
+static bool g_sk_malloc_will_throw = true;
+
#ifdef SK_TAG_BLOCKS
#include "SkThread.h"
@@ -257,7 +259,13 @@
size += sizeof(SkBlockHeader);
#endif
+ if (!(flags & SK_MALLOC_THROW)) {
+ g_sk_malloc_will_throw = false;
+ }
void* p = malloc(size);
+ if (!(flags & SK_MALLOC_THROW)) {
+ g_sk_malloc_will_throw = true;
+ }
if (p == NULL)
{
if (flags & SK_MALLOC_THROW)
@@ -278,3 +286,7 @@
return p;
}
+bool sk_malloc_will_throw()
+{
+ return g_sk_malloc_will_throw;
+}
« no previous file with comments | « chrome/app/chrome_dll_main.cc ('k') | skia/include/corecg/SkTypes.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698