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

Unified Diff: skia/ext/SkMemory_new_handler.cpp

Issue 10908245: unchecked_malloc() for Skia on OSX. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Put EBADF/syslog commentary back. Created 8 years, 3 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 | « base/process_util_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: skia/ext/SkMemory_new_handler.cpp
diff --git a/skia/ext/SkMemory_new_handler.cpp b/skia/ext/SkMemory_new_handler.cpp
index 5f958c67424c3d8562bd7d39489b36c8c96d07c2..2ab49e3e6a47387359f3fd2e772c831b8492dafe 100644
--- a/skia/ext/SkMemory_new_handler.cpp
+++ b/skia/ext/SkMemory_new_handler.cpp
@@ -6,6 +6,8 @@
#include <stdlib.h>
#include <new>
+#include "base/process_util.h"
+
#include "third_party/skia/include/core/SkTypes.h"
#include "third_party/skia/include/core/SkThread.h"
@@ -54,10 +56,14 @@ void* sk_malloc_flags(size_t size, unsigned flags) {
p = malloc(size);
#else
if (!(flags & SK_MALLOC_THROW)) {
+#if defined(OS_MACOSX)
+ p = base::UncheckedMalloc(size);
+#else
SkAutoMutexAcquire lock(gSkNewHandlerMutex);
std::new_handler old_handler = std::set_new_handler(NULL);
p = malloc(size);
std::set_new_handler(old_handler);
+#endif
} else {
p = malloc(size);
}
« no previous file with comments | « base/process_util_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698