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

Unified Diff: third_party/WebKit/Source/platform/heap/CallbackStack.h

Issue 1686943002: Oilpan: Decommit backing storage of CallbackStacks (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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 | third_party/WebKit/Source/platform/heap/CallbackStack.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/platform/heap/CallbackStack.h
diff --git a/third_party/WebKit/Source/platform/heap/CallbackStack.h b/third_party/WebKit/Source/platform/heap/CallbackStack.h
index 0d60ebc3da73d0ae7f40f3fdca1ab4f4db56057d..78256e82d4f3f51c17c1db0c6f26cc2ee8604212 100644
--- a/third_party/WebKit/Source/platform/heap/CallbackStack.h
+++ b/third_party/WebKit/Source/platform/heap/CallbackStack.h
@@ -41,6 +41,7 @@ public:
~CallbackStack();
void clear();
+ void decommit();
Item* allocateEntry();
Item* pop();
@@ -54,25 +55,18 @@ public:
#endif
private:
- static const size_t blockSize = 8192;
+ static const size_t blockSize = (1 << 13);
class Block {
USING_FAST_MALLOC(Block);
public:
- explicit Block(Block* next)
- : m_limit(&(m_buffer[blockSize]))
- , m_current(&(m_buffer[0]))
- , m_next(next)
- {
- clearUnused();
- }
-
- ~Block()
- {
- clearUnused();
- }
+ explicit Block(Block* next);
+ ~Block();
+#if ENABLE(ASSERT)
void clear();
+#endif
+ void decommit();
Block* next() const { return m_next; }
void setNext(Block* next) { m_next = next; }
@@ -82,11 +76,6 @@ private:
return m_current == &(m_buffer[0]);
}
- size_t size() const
- {
- return blockSize - (m_limit - m_current);
- }
-
Item* allocateEntry()
{
if (LIKELY(m_current < m_limit))
@@ -107,9 +96,7 @@ private:
#endif
private:
- void clearUnused();
-
- Item m_buffer[blockSize];
+ Item* m_buffer;
Item* m_limit;
Item* m_current;
Block* m_next;
« no previous file with comments | « no previous file | third_party/WebKit/Source/platform/heap/CallbackStack.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698