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

Side by Side Diff: third_party/WebKit/Source/platform/heap/CallbackStack.cpp

Issue 1741833002: Reduce ephemeron stack size reservation. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: const-ify 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "platform/heap/CallbackStack.h" 5 #include "platform/heap/CallbackStack.h"
6 #include "wtf/PageAllocator.h" 6 #include "wtf/PageAllocator.h"
7 7
8 namespace blink { 8 namespace blink {
9 9
10 size_t const CallbackStack::kMinimalBlockSize = WTF::kPageAllocationGranularity / sizeof(CallbackStack::Item);
11
10 CallbackStack::Block::Block(Block* next, size_t blockSize) 12 CallbackStack::Block::Block(Block* next, size_t blockSize)
11 : m_blockSize(blockSize) 13 : m_blockSize(blockSize)
12 { 14 {
13 // Allocated block size must be a multiple of WTF::kPageAllocationGranularit y. 15 // Allocated block size must be a multiple of WTF::kPageAllocationGranularit y.
14 ASSERT((m_blockSize * sizeof(Item)) % WTF::kPageAllocationGranularity == 0); 16 ASSERT((m_blockSize * sizeof(Item)) % WTF::kPageAllocationGranularity == 0);
15 m_buffer = static_cast<Item*>(WTF::allocPages(nullptr, m_blockSize * sizeof( Item), WTF::kPageAllocationGranularity, WTF::PageAccessible)); 17 m_buffer = static_cast<Item*>(WTF::allocPages(nullptr, m_blockSize * sizeof( Item), WTF::kPageAllocationGranularity, WTF::PageAccessible));
16 RELEASE_ASSERT(m_buffer); 18 RELEASE_ASSERT(m_buffer);
17 19
18 #if ENABLE(ASSERT) 20 #if ENABLE(ASSERT)
19 clear(); 21 clear();
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
168 { 170 {
169 for (Block* current = m_first; current; current = current->next()) { 171 for (Block* current = m_first; current; current = current->next()) {
170 if (current->hasCallbackForObject(object)) 172 if (current->hasCallbackForObject(object))
171 return true; 173 return true;
172 } 174 }
173 return false; 175 return false;
174 } 176 }
175 #endif 177 #endif
176 178
177 } // namespace blink 179 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/platform/heap/CallbackStack.h ('k') | third_party/WebKit/Source/platform/heap/Heap.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698