summaryrefslogtreecommitdiff
path: root/src/malloc_extension.cc
diff options
context:
space:
mode:
authorcsilvers <csilvers@6b5cf1ce-ec42-a296-1ba9-69fdba395a50>2009-10-27 17:30:52 +0000
committercsilvers <csilvers@6b5cf1ce-ec42-a296-1ba9-69fdba395a50>2009-10-27 17:30:52 +0000
commit25eed16e1b042a80c9a3e83bbf7ed227d04fb45a (patch)
tree0b5a4ab27f62b2170e30925952d646f7dd1228bb /src/malloc_extension.cc
parent19dfa9e3733155e57406fbd082273eb53cb2750e (diff)
downloadgperftools-25eed16e1b042a80c9a3e83bbf7ed227d04fb45a.tar.gz
* Fix Symbolize() to call pprof once, rather than once/symbol (glider)
* Fix unsetting of hooks before forking, in debug mode (maxim) * Add some documention for pmuprofile (aruns) * Speed up futex with FUTEX_PRIVATE_FLAG (m3b) * Fix os x 10.6: prefer sys/ucontext.h to ucontext.h (csilvers) * Fix C shims to be actually valid C: malloc_extension/etc (csilvers) * Fix a longtime memset bug (csilvers) * Implement nothrow versions of delete (csilvers) * Fix recursively-unmapped-region accounting (ppluzhnikov) * Better distinguish between real and fake VDSO (ppluzhnikov) * Modify span coalescing to improve performance (sanjay) * WINDOWS: Remove unnecessary lock around VirtualAlloc (mbelshe) * Remove performance tests for ptmalloc2 (csilvers) git-svn-id: http://gperftools.googlecode.com/svn/trunk@77 6b5cf1ce-ec42-a296-1ba9-69fdba395a50
Diffstat (limited to 'src/malloc_extension.cc')
-rw-r--r--src/malloc_extension.cc22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/malloc_extension.cc b/src/malloc_extension.cc
index b156972..068a693 100644
--- a/src/malloc_extension.cc
+++ b/src/malloc_extension.cc
@@ -123,7 +123,7 @@ bool MallocExtension::MallocMemoryStats(int* blocks, size_t* total,
int histogram[kMallocHistogramSize]) {
*blocks = 0;
*total = 0;
- memset(histogram, 0, sizeof(histogram));
+ memset(histogram, 0, sizeof(*histogram) * kMallocHistogramSize);
return true;
}
@@ -307,23 +307,23 @@ void MallocExtension::GetHeapGrowthStacks(MallocExtensionWriter* writer) {
return MallocExtension::instance()->fn arglist; \
}
-C_SHIM(VerifyAllMemory, bool, (), ());
-C_SHIM(VerifyNewMemory, bool, (void* p), (p));
-C_SHIM(VerifyArrayNewMemory, bool, (void* p), (p));
-C_SHIM(VerifyMallocMemory, bool, (void* p), (p));
-C_SHIM(MallocMemoryStats, bool,
+C_SHIM(VerifyAllMemory, int, (void), ());
+C_SHIM(VerifyNewMemory, int, (void* p), (p));
+C_SHIM(VerifyArrayNewMemory, int, (void* p), (p));
+C_SHIM(VerifyMallocMemory, int, (void* p), (p));
+C_SHIM(MallocMemoryStats, int,
(int* blocks, size_t* total, int histogram[kMallocHistogramSize]),
(blocks, total, histogram));
C_SHIM(GetStats, void,
(char* buffer, int buffer_length), (buffer, buffer_length));
-C_SHIM(GetNumericProperty, bool,
+C_SHIM(GetNumericProperty, int,
(const char* property, size_t* value), (property, value));
-C_SHIM(SetNumericProperty, bool,
+C_SHIM(SetNumericProperty, int,
(const char* property, size_t value), (property, value));
-C_SHIM(MarkThreadIdle, void, (), ());
-C_SHIM(MarkThreadBusy, void, (), ());
-C_SHIM(ReleaseFreeMemory, void, (), ());
+C_SHIM(MarkThreadIdle, void, (void), ());
+C_SHIM(MarkThreadBusy, void, (void), ());
+C_SHIM(ReleaseFreeMemory, void, (void), ());
C_SHIM(GetEstimatedAllocatedSize, size_t, (size_t size), (size));
C_SHIM(GetAllocatedSize, size_t, (void* p), (p));