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

Unified Diff: Source/wtf/PartitionAlloc.h

Issue 133863006: PartitionAlloc: wait just a little while before actually freeing empty pages. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Review. Created 6 years, 11 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
« no previous file with comments | « no previous file | Source/wtf/PartitionAlloc.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/wtf/PartitionAlloc.h
diff --git a/Source/wtf/PartitionAlloc.h b/Source/wtf/PartitionAlloc.h
index 92fa182d31e763fdcc8388e1c233ce587e6255d0..4bb5abe26081d751090c9350f05bdb70915aa3fa 100644
--- a/Source/wtf/PartitionAlloc.h
+++ b/Source/wtf/PartitionAlloc.h
@@ -183,6 +183,8 @@ static const size_t kGenericMaxBucketSpacing = 1 << ((kGenericMaxBucketedOrder -
static const size_t kGenericMaxBucketed = (1 << (kGenericMaxBucketedOrder - 1)) + ((kGenericNumBucketsPerOrder - 1) * kGenericMaxBucketSpacing);
static const size_t kBitsPerSizet = sizeof(void*) * CHAR_BIT;
+// Constants for the memory reclaim logic.
+static const size_t kMaxFreeableSpans = 16;
#ifndef NDEBUG
// These two byte values match tcmalloc.
@@ -195,8 +197,8 @@ static const uintptr_t kCookieValue = 0xDEADBEEFu;
#endif
#endif
-struct PartitionRootBase;
struct PartitionBucket;
+struct PartitionRootBase;
struct PartitionFreelistEntry {
PartitionFreelistEntry* next;
@@ -229,6 +231,7 @@ struct PartitionPage {
int16_t numAllocatedSlots; // Deliberately signed, -1 for free page, -n for full pages.
uint16_t numUnprovisionedSlots;
uint16_t pageOffset;
+ int16_t freeCacheIndex; // -1 if not in the free cache.
};
struct PartitionBucket {
@@ -259,6 +262,8 @@ struct WTF_EXPORT PartitionRootBase {
char* nextPartitionPageEnd;
PartitionSuperPageExtentEntry* currentExtent;
PartitionSuperPageExtentEntry* firstExtent;
+ PartitionPage* globalEmptyPageRing[kMaxFreeableSpans];
+ size_t globalEmptyPageRingIndex;
uintptr_t invertedSelf;
static int gInitializedLock;
« no previous file with comments | « no previous file | Source/wtf/PartitionAlloc.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698