summaryrefslogtreecommitdiffstats
path: root/third_party/tcmalloc/chromium/src/malloc_extension.cc
diff options
context:
space:
mode:
Diffstat (limited to 'third_party/tcmalloc/chromium/src/malloc_extension.cc')
-rw-r--r--third_party/tcmalloc/chromium/src/malloc_extension.cc11
1 files changed, 10 insertions, 1 deletions
diff --git a/third_party/tcmalloc/chromium/src/malloc_extension.cc b/third_party/tcmalloc/chromium/src/malloc_extension.cc
index 068a693..4ce262f 100644
--- a/third_party/tcmalloc/chromium/src/malloc_extension.cc
+++ b/third_party/tcmalloc/chromium/src/malloc_extension.cc
@@ -143,10 +143,14 @@ void MallocExtension::MarkThreadBusy() {
// Default implementation does nothing
}
-void MallocExtension::ReleaseFreeMemory() {
+void MallocExtension::ReleaseToSystem(size_t num_bytes) {
// Default implementation does nothing
}
+void MallocExtension::ReleaseFreeMemory() {
+ ReleaseToSystem(static_cast<size_t>(-1)); // SIZE_T_MAX
+}
+
void MallocExtension::SetMemoryReleaseRate(double rate) {
// Default implementation does nothing
}
@@ -300,6 +304,10 @@ void MallocExtension::GetHeapGrowthStacks(MallocExtensionWriter* writer) {
DumpAddressMap(writer);
}
+void MallocExtension::Ranges(void* arg, RangeFunction func) {
+ // No callbacks by default
+}
+
// These are C shims that work on the current instance.
#define C_SHIM(fn, retval, paramlist, arglist) \
@@ -325,5 +333,6 @@ C_SHIM(SetNumericProperty, int,
C_SHIM(MarkThreadIdle, void, (void), ());
C_SHIM(MarkThreadBusy, void, (void), ());
C_SHIM(ReleaseFreeMemory, void, (void), ());
+C_SHIM(ReleaseToSystem, void, (size_t num_bytes), (num_bytes));
C_SHIM(GetEstimatedAllocatedSize, size_t, (size_t size), (size));
C_SHIM(GetAllocatedSize, size_t, (void* p), (p));