| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "base/process_util.h" | 5 #include "base/process_util.h" |
| 6 | 6 |
| 7 #include <ctype.h> | 7 #include <ctype.h> |
| 8 #include <dirent.h> | 8 #include <dirent.h> |
| 9 #include <dlfcn.h> | 9 #include <dlfcn.h> |
| 10 #include <errno.h> | 10 #include <errno.h> |
| (...skipping 592 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 603 LOG(FATAL) << "Out of memory."; | 603 LOG(FATAL) << "Out of memory."; |
| 604 } | 604 } |
| 605 | 605 |
| 606 void OnNoMemory() { | 606 void OnNoMemory() { |
| 607 OnNoMemorySize(0); | 607 OnNoMemorySize(0); |
| 608 } | 608 } |
| 609 | 609 |
| 610 } // namespace | 610 } // namespace |
| 611 | 611 |
| 612 extern "C" { | 612 extern "C" { |
| 613 #if !defined(USE_TCMALLOC) | 613 #if 0 |
| 614 | 614 |
| 615 extern "C" { | 615 extern "C" { |
| 616 void* __libc_malloc(size_t size); | 616 void* __libc_malloc(size_t size); |
| 617 void* __libc_realloc(void* ptr, size_t size); | 617 void* __libc_realloc(void* ptr, size_t size); |
| 618 void* __libc_calloc(size_t nmemb, size_t size); | 618 void* __libc_calloc(size_t nmemb, size_t size); |
| 619 void* __libc_valloc(size_t size); | 619 void* __libc_valloc(size_t size); |
| 620 void* __libc_pvalloc(size_t size); | 620 void* __libc_pvalloc(size_t size); |
| 621 void* __libc_memalign(size_t alignment, size_t size); | 621 void* __libc_memalign(size_t alignment, size_t size); |
| 622 } // extern "C" | 622 } // extern "C" |
| 623 | 623 |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 706 | 706 |
| 707 if (!file_util::PathExists(oom_adj)) | 707 if (!file_util::PathExists(oom_adj)) |
| 708 return false; | 708 return false; |
| 709 | 709 |
| 710 std::string score_str = base::IntToString(score); | 710 std::string score_str = base::IntToString(score); |
| 711 return (static_cast<int>(score_str.length()) == | 711 return (static_cast<int>(score_str.length()) == |
| 712 file_util::WriteFile(oom_adj, score_str.c_str(), score_str.length())); | 712 file_util::WriteFile(oom_adj, score_str.c_str(), score_str.length())); |
| 713 } | 713 } |
| 714 | 714 |
| 715 } // namespace base | 715 } // namespace base |
| OLD | NEW |