diff options
Diffstat (limited to 'src/tcmalloc.cc')
-rw-r--r-- | src/tcmalloc.cc | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/tcmalloc.cc b/src/tcmalloc.cc index 0fa880c..9ec663e 100644 --- a/src/tcmalloc.cc +++ b/src/tcmalloc.cc @@ -163,6 +163,7 @@ using tcmalloc::Static; using tcmalloc::ThreadCache; DECLARE_double(tcmalloc_release_rate); +DECLARE_int64(tcmalloc_heap_limit_mb); // Those common architectures are known to be safe w.r.t. aliasing function // with "extra" unused args to function with fewer arguments (e.g. @@ -835,6 +836,12 @@ class TCMallocImplementation : public MallocExtension { return true; } + if (strcmp(name, "tcmalloc.heap_limit_mb") == 0) { + SpinLockHolder l(Static::pageheap_lock()); + *value = FLAGS_tcmalloc_heap_limit_mb; + return true; + } + return false; } @@ -853,6 +860,12 @@ class TCMallocImplementation : public MallocExtension { return true; } + if (strcmp(name, "tcmalloc.heap_limit_mb") == 0) { + SpinLockHolder l(Static::pageheap_lock()); + FLAGS_tcmalloc_heap_limit_mb = value; + return true; + } + return false; } |