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

Unified Diff: third_party/tcmalloc/chromium/src/page_heap.h

Issue 7050034: Merge google-perftools r109 (the current contents of third_party/tcmalloc/vendor) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 6 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 side-by-side diff with in-line comments
Download patch
Index: third_party/tcmalloc/chromium/src/page_heap.h
===================================================================
--- third_party/tcmalloc/chromium/src/page_heap.h (revision 88335)
+++ third_party/tcmalloc/chromium/src/page_heap.h (working copy)
@@ -34,7 +34,12 @@
#define TCMALLOC_PAGE_HEAP_H_
#include <config.h>
+#include <stddef.h> // for size_t
+#ifdef HAVE_STDINT_H
+#include <stdint.h> // for uint64_t, int64_t, uint16_t
+#endif
#include <google/malloc_extension.h>
+#include "base/basictypes.h"
#include "common.h"
#include "packed-cache-inl.h"
#include "pagemap.h"
@@ -50,6 +55,8 @@
// This #ifdef should almost never be set. Set NO_TCMALLOC_SAMPLES if
// you're porting to a system where you really can't get a stacktrace.
+// Because we control the definition of GetStackTrace, all clients of
+// GetStackTrace should #include us rather than stacktrace.h.
#ifdef NO_TCMALLOC_SAMPLES
// We use #define so code compiles even if you #include stacktrace.h somehow.
# define GetStackTrace(stack, depth, skip) (0)
@@ -57,6 +64,11 @@
# include <google/stacktrace.h>
#endif
+class TCMalloc_Printer;
+namespace base {
+struct MallocRange;
+}
+
namespace tcmalloc {
// -------------------------------------------------------------------------
@@ -150,6 +162,10 @@
};
inline Stats stats() const { return stats_; }
+ void GetClassSizes(int64 class_sizes_normal[kMaxPages],
+ int64 class_sizes_returned[kMaxPages],
+ int64* normal_pages_in_spans,
+ int64* returned_pages_in_spans);
bool Check();
// Like Check() but does some more comprehensive checking.
@@ -186,12 +202,9 @@
// should keep this value big because various incarnations of Linux
// have small limits on the number of mmap() regions per
// address-space.
- static const int kMinSystemAlloc = 1 << (20 - kPageShift);
+ // REQUIRED: kMinSystemAlloc <= kMaxPages;
+ static const int kMinSystemAlloc = kMaxPages;
- // For all span-lengths < kMaxPages we keep an exact-size list.
- // REQUIRED: kMaxPages >= kMinSystemAlloc;
- static const size_t kMaxPages = kMinSystemAlloc;
-
// Never delay scavenging for more than the following number of
// deallocated pages. With 4K pages, this comes to 4GB of
// deallocation.
@@ -204,8 +217,8 @@
static const int kDefaultReleaseDelay = 1 << 12;
// Pick the appropriate map and cache types based on pointer size
- typedef MapSelector<8*sizeof(uintptr_t)>::Type PageMap;
- typedef MapSelector<8*sizeof(uintptr_t)>::CacheType PageMapCache;
+ typedef MapSelector<kAddressBits>::Type PageMap;
+ typedef MapSelector<kAddressBits>::CacheType PageMapCache;
PageMap pagemap_;
mutable PageMapCache pagemap_cache_;
@@ -225,6 +238,8 @@
// Statistics on system, free, and unmapped bytes
Stats stats_;
+ Span* SearchFreeAndLargeLists(Length n);
+
bool GrowHeap(Length n);
// REQUIRES: span->length >= n
« no previous file with comments | « third_party/tcmalloc/chromium/src/packed-cache-inl.h ('k') | third_party/tcmalloc/chromium/src/page_heap.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698