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

Side by Side Diff: base/process_util_linux.cc

Issue 17654007: Don't override system malloc when built with LeakSanitizer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years, 6 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 | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 <dirent.h> 7 #include <dirent.h>
8 #include <malloc.h> 8 #include <malloc.h>
9 #include <sys/time.h> 9 #include <sys/time.h>
10 #include <sys/types.h> 10 #include <sys/types.h>
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 LOG(FATAL) << "Out of memory."; 62 LOG(FATAL) << "Out of memory.";
63 } 63 }
64 64
65 void OnNoMemory() { 65 void OnNoMemory() {
66 OnNoMemorySize(0); 66 OnNoMemorySize(0);
67 } 67 }
68 68
69 } // namespace 69 } // namespace
70 70
71 #if !defined(ADDRESS_SANITIZER) && !defined(MEMORY_SANITIZER) && \ 71 #if !defined(ADDRESS_SANITIZER) && !defined(MEMORY_SANITIZER) && \
72 !defined(THREAD_SANITIZER) 72 !defined(THREAD_SANITIZER) && !defined(LEAK_SANITIZER)
73 73
74 #if defined(LIBC_GLIBC) && !defined(USE_TCMALLOC) 74 #if defined(LIBC_GLIBC) && !defined(USE_TCMALLOC)
75 75
76 extern "C" { 76 extern "C" {
77 void* __libc_malloc(size_t size); 77 void* __libc_malloc(size_t size);
78 void* __libc_realloc(void* ptr, size_t size); 78 void* __libc_realloc(void* ptr, size_t size);
79 void* __libc_calloc(size_t nmemb, size_t size); 79 void* __libc_calloc(size_t nmemb, size_t size);
80 void* __libc_valloc(size_t size); 80 void* __libc_valloc(size_t size);
81 void* __libc_pvalloc(size_t size); 81 void* __libc_pvalloc(size_t size);
82 void* __libc_memalign(size_t alignment, size_t size); 82 void* __libc_memalign(size_t alignment, size_t size);
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
210 int score_len = static_cast<int>(score_str.length()); 210 int score_len = static_cast<int>(score_str.length());
211 return (score_len == file_util::WriteFile(oom_file, 211 return (score_len == file_util::WriteFile(oom_file,
212 score_str.c_str(), 212 score_str.c_str(),
213 score_len)); 213 score_len));
214 } 214 }
215 215
216 return false; 216 return false;
217 } 217 }
218 218
219 } // namespace base 219 } // namespace base
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698