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

Side by Side Diff: third_party/tcmalloc/chromium/src/malloc_extension.cc

Issue 1076002: Revert 41938 - Merged third_party/tcmalloc/vendor/src(googleperftools r87) in... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 10 years, 9 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2005, Google Inc. 1 // Copyright (c) 2005, Google Inc.
2 // All rights reserved. 2 // All rights reserved.
3 // 3 //
4 // Redistribution and use in source and binary forms, with or without 4 // Redistribution and use in source and binary forms, with or without
5 // modification, are permitted provided that the following conditions are 5 // modification, are permitted provided that the following conditions are
6 // met: 6 // met:
7 // 7 //
8 // * Redistributions of source code must retain the above copyright 8 // * Redistributions of source code must retain the above copyright
9 // notice, this list of conditions and the following disclaimer. 9 // notice, this list of conditions and the following disclaimer.
10 // * Redistributions in binary form must reproduce the above 10 // * Redistributions in binary form must reproduce the above
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
136 } 136 }
137 137
138 void MallocExtension::MarkThreadIdle() { 138 void MallocExtension::MarkThreadIdle() {
139 // Default implementation does nothing 139 // Default implementation does nothing
140 } 140 }
141 141
142 void MallocExtension::MarkThreadBusy() { 142 void MallocExtension::MarkThreadBusy() {
143 // Default implementation does nothing 143 // Default implementation does nothing
144 } 144 }
145 145
146 void MallocExtension::ReleaseToSystem(size_t num_bytes) {
147 // Default implementation does nothing
148 }
149
150 void MallocExtension::ReleaseFreeMemory() { 146 void MallocExtension::ReleaseFreeMemory() {
151 ReleaseToSystem(static_cast<size_t>(-1)); // SIZE_T_MAX 147 // Default implementation does nothing
152 } 148 }
153 149
154 void MallocExtension::SetMemoryReleaseRate(double rate) { 150 void MallocExtension::SetMemoryReleaseRate(double rate) {
155 // Default implementation does nothing 151 // Default implementation does nothing
156 } 152 }
157 153
158 double MallocExtension::GetMemoryReleaseRate() { 154 double MallocExtension::GetMemoryReleaseRate() {
159 return -1.0; 155 return -1.0;
160 } 156 }
161 157
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
297 // client wants to focus on the latest stack traces. 293 // client wants to focus on the latest stack traces.
298 PrintHeader(writer, "growth", entries); 294 PrintHeader(writer, "growth", entries);
299 for (void** entry = entries; Count(entry) != 0; entry += 3 + Depth(entry)) { 295 for (void** entry = entries; Count(entry) != 0; entry += 3 + Depth(entry)) {
300 PrintStackEntry(writer, entry); 296 PrintStackEntry(writer, entry);
301 } 297 }
302 delete[] entries; 298 delete[] entries;
303 299
304 DumpAddressMap(writer); 300 DumpAddressMap(writer);
305 } 301 }
306 302
307 void MallocExtension::Ranges(void* arg, RangeFunction func) {
308 // No callbacks by default
309 }
310
311 // These are C shims that work on the current instance. 303 // These are C shims that work on the current instance.
312 304
313 #define C_SHIM(fn, retval, paramlist, arglist) \ 305 #define C_SHIM(fn, retval, paramlist, arglist) \
314 extern "C" PERFTOOLS_DLL_DECL retval MallocExtension_##fn paramlist { \ 306 extern "C" PERFTOOLS_DLL_DECL retval MallocExtension_##fn paramlist { \
315 return MallocExtension::instance()->fn arglist; \ 307 return MallocExtension::instance()->fn arglist; \
316 } 308 }
317 309
318 C_SHIM(VerifyAllMemory, int, (void), ()); 310 C_SHIM(VerifyAllMemory, int, (void), ());
319 C_SHIM(VerifyNewMemory, int, (void* p), (p)); 311 C_SHIM(VerifyNewMemory, int, (void* p), (p));
320 C_SHIM(VerifyArrayNewMemory, int, (void* p), (p)); 312 C_SHIM(VerifyArrayNewMemory, int, (void* p), (p));
321 C_SHIM(VerifyMallocMemory, int, (void* p), (p)); 313 C_SHIM(VerifyMallocMemory, int, (void* p), (p));
322 C_SHIM(MallocMemoryStats, int, 314 C_SHIM(MallocMemoryStats, int,
323 (int* blocks, size_t* total, int histogram[kMallocHistogramSize]), 315 (int* blocks, size_t* total, int histogram[kMallocHistogramSize]),
324 (blocks, total, histogram)); 316 (blocks, total, histogram));
325 317
326 C_SHIM(GetStats, void, 318 C_SHIM(GetStats, void,
327 (char* buffer, int buffer_length), (buffer, buffer_length)); 319 (char* buffer, int buffer_length), (buffer, buffer_length));
328 C_SHIM(GetNumericProperty, int, 320 C_SHIM(GetNumericProperty, int,
329 (const char* property, size_t* value), (property, value)); 321 (const char* property, size_t* value), (property, value));
330 C_SHIM(SetNumericProperty, int, 322 C_SHIM(SetNumericProperty, int,
331 (const char* property, size_t value), (property, value)); 323 (const char* property, size_t value), (property, value));
332 324
333 C_SHIM(MarkThreadIdle, void, (void), ()); 325 C_SHIM(MarkThreadIdle, void, (void), ());
334 C_SHIM(MarkThreadBusy, void, (void), ()); 326 C_SHIM(MarkThreadBusy, void, (void), ());
335 C_SHIM(ReleaseFreeMemory, void, (void), ()); 327 C_SHIM(ReleaseFreeMemory, void, (void), ());
336 C_SHIM(ReleaseToSystem, void, (size_t num_bytes), (num_bytes));
337 C_SHIM(GetEstimatedAllocatedSize, size_t, (size_t size), (size)); 328 C_SHIM(GetEstimatedAllocatedSize, size_t, (size_t size), (size));
338 C_SHIM(GetAllocatedSize, size_t, (void* p), (p)); 329 C_SHIM(GetAllocatedSize, size_t, (void* p), (p));
OLDNEW
« no previous file with comments | « third_party/tcmalloc/chromium/src/heap-profile-table.cc ('k') | third_party/tcmalloc/chromium/src/malloc_hook.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698