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

Unified Diff: base/process/memory_linux.cc

Issue 2201363002: android: Enable death on malloc/operator new failure. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Disable 2GB tests on Android though, they pass just because VM space is fragmented on 32 bit devices Created 4 years, 4 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 | « no previous file | base/process/memory_unittest.cc » ('j') | base/process/memory_unittest.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/process/memory_linux.cc
diff --git a/base/process/memory_linux.cc b/base/process/memory_linux.cc
index 9fb630b4750bff97a952850c655b8159fe9c075d..985bc54eb64439c68878671134d014e26c1a8cfd 100644
--- a/base/process/memory_linux.cc
+++ b/base/process/memory_linux.cc
@@ -27,7 +27,6 @@ size_t g_oom_size = 0U;
namespace {
-#if !defined(OS_ANDROID)
void OnNoMemorySize(size_t size) {
g_oom_size = size;
@@ -39,7 +38,6 @@ void OnNoMemorySize(size_t size) {
void OnNoMemory() {
OnNoMemorySize(0);
}
-#endif // !defined(OS_ANDROID)
} // namespace
@@ -147,15 +145,10 @@ void EnableTerminationOnHeapCorruption() {
}
void EnableTerminationOnOutOfMemory() {
-#if defined(OS_ANDROID)
- // Android doesn't support setting a new handler.
- DLOG(WARNING) << "Not feasible.";
-#else
// Set the new-out of memory handler.
std::set_new_handler(&OnNoMemory);
// If we're using glibc's allocator, the above functions will override
// malloc and friends and make them die on out of memory.
-#endif
#if BUILDFLAG(USE_EXPERIMENTAL_ALLOCATOR_SHIM)
allocator::SetCallNewHandlerOnMallocFailure(true);
« no previous file with comments | « no previous file | base/process/memory_unittest.cc » ('j') | base/process/memory_unittest.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698