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

Unified Diff: third_party/WebKit/Source/platform/heap/PagePool.cpp

Issue 2683373002: Remove a redundant template from PagePool (Closed)
Patch Set: temp Created 3 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 | « third_party/WebKit/Source/platform/heap/PagePool.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/platform/heap/PagePool.cpp
diff --git a/third_party/WebKit/Source/platform/heap/PagePool.cpp b/third_party/WebKit/Source/platform/heap/PagePool.cpp
index e9c7bff461caa8989fc4e7657be5807461674708..229732270375a88ec20776b39507402a92806330 100644
--- a/third_party/WebKit/Source/platform/heap/PagePool.cpp
+++ b/third_party/WebKit/Source/platform/heap/PagePool.cpp
@@ -10,7 +10,13 @@
namespace blink {
-FreePagePool::~FreePagePool() {
+PagePool::PagePool() {
+ for (int i = 0; i < BlinkGC::NumberOfArenas; ++i) {
+ m_pool[i] = nullptr;
+ }
+}
+
+PagePool::~PagePool() {
for (int index = 0; index < BlinkGC::NumberOfArenas; ++index) {
while (PoolEntry* entry = m_pool[index]) {
m_pool[index] = entry->next;
@@ -22,7 +28,7 @@ FreePagePool::~FreePagePool() {
}
}
-void FreePagePool::addFreePage(int index, PageMemory* memory) {
+void PagePool::add(int index, PageMemory* memory) {
// When adding a page to the pool we decommit it to ensure it is unused
// while in the pool. This also allows the physical memory, backing the
// page, to be given back to the OS.
@@ -32,7 +38,7 @@ void FreePagePool::addFreePage(int index, PageMemory* memory) {
m_pool[index] = entry;
}
-PageMemory* FreePagePool::takeFreePage(int index) {
+PageMemory* PagePool::take(int index) {
MutexLocker locker(m_mutex[index]);
while (PoolEntry* entry = m_pool[index]) {
m_pool[index] = entry->next;
« no previous file with comments | « third_party/WebKit/Source/platform/heap/PagePool.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698