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

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

Issue 1737913002: Parameterize CallbackStack over initial block size. (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 78256e82d4f3f51c17c1db0c6f26cc2ee8604212..753941c4c9727248f109da4078faf1830d418b88 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 blockSize = defaultBlockSize);
~CallbackStack();
void clear();
@@ -55,12 +55,12 @@ public:
#endif
private:
- static const size_t blockSize = (1 << 13);
+ static const size_t defaultBlockSize = (1 << 13);
class Block {
USING_FAST_MALLOC(Block);
public:
- explicit Block(Block* next);
+ Block(Block* next, size_t blockSize);
~Block();
#if ENABLE(ASSERT)
@@ -76,6 +76,8 @@ private:
return m_current == &(m_buffer[0]);
}
+ size_t blockSize() const { return m_blockSize; }
+
Item* allocateEntry()
{
if (LIKELY(m_current < m_limit))
@@ -91,11 +93,14 @@ private:
}
void invokeEphemeronCallbacks(Visitor*);
+
#if ENABLE(ASSERT)
bool hasCallbackForObject(const void*);
#endif
private:
+ size_t m_blockSize;
+
Item* m_buffer;
Item* m_limit;
Item* m_current;
« 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