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

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

Issue 1689823003: Revert of 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 b961e91a6863005459710176537ac1cf949b0bae..0d60ebc3da73d0ae7f40f3fdca1ab4f4db56057d 100644
--- a/third_party/WebKit/Source/platform/heap/CallbackStack.h
+++ b/third_party/WebKit/Source/platform/heap/CallbackStack.h
@@ -41,7 +41,6 @@
~CallbackStack();
void clear();
- void decommit();
Item* allocateEntry();
Item* pop();
@@ -55,15 +54,25 @@
#endif
private:
- static const size_t blockSize = (1 << 13);
+ static const size_t blockSize = 8192;
class Block {
USING_FAST_MALLOC(Block);
public:
- explicit Block(Block* next);
- ~Block();
+ explicit Block(Block* next)
+ : m_limit(&(m_buffer[blockSize]))
+ , m_current(&(m_buffer[0]))
+ , m_next(next)
+ {
+ clearUnused();
+ }
- void decommit();
+ ~Block()
+ {
+ clearUnused();
+ }
+
+ void clear();
Block* next() const { return m_next; }
void setNext(Block* next) { m_next = next; }
@@ -71,6 +80,11 @@
bool isEmptyBlock() const
{
return m_current == &(m_buffer[0]);
+ }
+
+ size_t size() const
+ {
+ return blockSize - (m_limit - m_current);
}
Item* allocateEntry()
@@ -93,7 +107,9 @@
#endif
private:
- Item* m_buffer;
+ void clearUnused();
+
+ Item m_buffer[blockSize];
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