summaryrefslogtreecommitdiff
path: root/src/debugallocation.cc
diff options
context:
space:
mode:
authorcsilvers <csilvers@6b5cf1ce-ec42-a296-1ba9-69fdba395a50>2010-11-18 01:07:25 +0000
committercsilvers <csilvers@6b5cf1ce-ec42-a296-1ba9-69fdba395a50>2010-11-18 01:07:25 +0000
commit3014cf142e5a2409c88ab4559f3274434ed9a29b (patch)
tree13c2dc85e8800116c4c7d3ef5f27ea0edc37d20f /src/debugallocation.cc
parent682ff7da1205398376ee725b4ce3219c107b3f8a (diff)
downloadgperftools-3014cf142e5a2409c88ab4559f3274434ed9a29b.tar.gz
* Suppress all large allocs when report threshold==0
* Clarified meaning of various malloc stats * Change from ATTRIBUTED_DEPRECATED to comments * Make array-size a var to compile under clang * Reduce page map key size under x86_64 by 4.4MB * Added full qualification to MemoryBarrier * Support systems that capitalize /proc weirdly * Avoid gcc warning: exporting type in unnamed ns * Add some dynamic annotations for gcc attributes * Add support for census profiler in pprof * Speed up pprof's ExtractSymbols * Speed up GoogleOnce * Add pkg-config (.pc) files * Detect when __environ exists but is NULL * Improve spinlock contention performance * Add GetFreeListSizes * Improve sampling_test, eg by adding no-inline * Relax malloc_extension test-check for big pages * Add proper library version number information * Update from autoconf 2.64 to 2.65 * Better document how to write a server that works with pprof * Change FillProcSelfMaps to better handle out-of-space * No longer hook _aligned_malloc/free in windows * Handle function-forwarding in DLLs when patching (in windows) * Update .vcproj files that had wrong .cc files in them (!) * get rid of unnecessary 'size < 0' * fix comments a bit in sysinfo.cc * another go at improving malloc-stats output * fix comment typo in profiler.cc * Add a few more thread annotations * Try to read TSC frequency from 'tsc_freq_khz' * Fix annotalysis/TSAN incompatibility * Add pprof --evince to go along with --gv * Document need for sampling to use GetHeapSample * Fix flakiness in malloc_extension_test * Separate out synchronization profiling routines git-svn-id: http://gperftools.googlecode.com/svn/trunk@99 6b5cf1ce-ec42-a296-1ba9-69fdba395a50
Diffstat (limited to 'src/debugallocation.cc')
-rw-r--r--src/debugallocation.cc16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/debugallocation.cc b/src/debugallocation.cc
index 949fbe9..3b34c8c 100644
--- a/src/debugallocation.cc
+++ b/src/debugallocation.cc
@@ -497,7 +497,7 @@ class MallocBlock {
// practical effect is that allocations are limited to 4Gb or so, even if
// the address space could take more.
static size_t max_size_t = ~0;
- if (size < 0 || size > max_size_t - sizeof(MallocBlock)) {
+ if (size > max_size_t - sizeof(MallocBlock)) {
RAW_LOG(ERROR, "Massive size passed to malloc: %"PRIuS"", size);
return NULL;
}
@@ -1356,6 +1356,20 @@ class DebugMallocImplementation : public ParentImplementation {
virtual size_t GetEstimatedAllocatedSize(size_t size) {
return size;
}
+
+ virtual void GetFreeListSizes(vector<MallocExtension::FreeListInfo>* v) {
+ static const char* kDebugFreeQueue = "debug.free_queue";
+
+ ParentImplementation::GetFreeListSizes(v);
+
+ MallocExtension::FreeListInfo i;
+ i.type = kDebugFreeQueue;
+ i.min_object_size = 0;
+ i.max_object_size = numeric_limits<size_t>::max();
+ i.total_bytes_free = MallocBlock::FreeQueueSize();
+ v->push_back(i);
+ }
+
};
static DebugMallocImplementation debug_malloc_implementation;