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

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

Issue 1695653004: Oilpan: Reduce the reserved size of CallbackStacks 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
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..4d24b043b1bac49315fca35cf20b92596fc07353 100644
--- a/third_party/WebKit/Source/platform/heap/CallbackStack.h
+++ b/third_party/WebKit/Source/platform/heap/CallbackStack.h
@@ -37,7 +37,7 @@ public:
VisitorCallback m_callback;
};
- CallbackStack();
+ explicit CallbackStack(size_t);
~CallbackStack();
void clear();
@@ -54,39 +54,23 @@ public:
#endif
private:
- static const size_t blockSize = 8192;
-
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*, size_t);
+ ~Block();
void clear();
Block* next() const { return m_next; }
void setNext(Block* next) { m_next = next; }
+ size_t blockSize() const { return m_blockSize; }
bool isEmptyBlock() const
{
return m_current == &(m_buffer[0]);
}
- size_t size() const
- {
- return blockSize - (m_limit - m_current);
- }
-
Item* allocateEntry()
{
if (LIKELY(m_current < m_limit))
@@ -109,10 +93,11 @@ private:
private:
void clearUnused();
- Item m_buffer[blockSize];
+ Item* m_buffer;
Item* m_limit;
Item* m_current;
Block* m_next;
+ size_t m_blockSize;
};
Item* popSlow();

Powered by Google App Engine
This is Rietveld 408576698