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

Unified Diff: third_party/tcmalloc/chromium/src/thread_cache.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/thread_cache.h
===================================================================
--- third_party/tcmalloc/chromium/src/thread_cache.h (revision 88335)
+++ third_party/tcmalloc/chromium/src/thread_cache.h (working copy)
@@ -35,8 +35,13 @@
#include <config.h>
#ifdef HAVE_PTHREAD
-#include <pthread.h>
+#include <pthread.h> // for pthread_t, pthread_key_t
#endif
+#include <stddef.h> // for size_t, NULL
+#ifdef HAVE_STDINT_H
+#include <stdint.h> // for uint32_t, uint64_t
+#endif
+#include <sys/types.h> // for ssize_t
#include "common.h"
#include "linked_list.h"
#include "maybe_threads.h"
@@ -44,6 +49,13 @@
#include "sampler.h"
#include "static_vars.h"
+#include "common.h" // for SizeMap, kMaxSize, etc
+#include "internal_logging.h" // for ASSERT, etc
+#include "linked_list.h" // for SLL_Pop, SLL_PopRange, etc
+#include "page_heap_allocator.h" // for PageHeapAllocator
+#include "sampler.h" // for Sampler
+#include "static_vars.h" // for Static
+
namespace tcmalloc {
// Even if we have support for thread-local storage in the compiler
@@ -63,9 +75,6 @@
class ThreadCache {
public:
- // Default bound on the total amount of thread caches.
- static const size_t kDefaultOverallThreadCacheSize = 16 << 20;
-
// All ThreadCache objects are kept in a linked list (for stats collection)
ThreadCache* next_;
ThreadCache* prev_;
@@ -213,19 +222,6 @@
}
};
- // The number of bytes one ThreadCache will steal from another when
- // the first ThreadCache is forced to Scavenge(), delaying the
- // next call to Scavenge for this thread.
- static const size_t kStealAmount = 1 << 16;
-
- // Lower and upper bounds on the per-thread cache sizes
- static const size_t kMinThreadCacheSize = kMaxSize * 2; //kStealAmount;
- static const size_t kMaxThreadCacheSize = 2 << 20;
-
- // The number of times that a deallocation can cause a freelist to
- // go over its max_length() before shrinking max_length().
- static const int kMaxOverages = 3;
-
// Gets and returns an object from the central cache, and, if possible,
// also adds some objects of that size class to this thread cache.
void* FetchFromCentralCache(size_t cl, size_t byte_size);
« no previous file with comments | « third_party/tcmalloc/chromium/src/tests/testutil.cc ('k') | third_party/tcmalloc/chromium/src/thread_cache.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698