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

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

Issue 1762093002: Avoid PageMemoryRegion::m_numPages data race. (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 | « third_party/WebKit/Source/platform/heap/PageMemory.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/PageMemory.cpp
diff --git a/third_party/WebKit/Source/platform/heap/PageMemory.cpp b/third_party/WebKit/Source/platform/heap/PageMemory.cpp
index 5efe1fcede7eb3036afbf20179a5dcfb76e7911d..d5d4cdf26b0e238919640d10a2a5e7ef53fec043 100644
--- a/third_party/WebKit/Source/platform/heap/PageMemory.cpp
+++ b/third_party/WebKit/Source/platform/heap/PageMemory.cpp
@@ -6,6 +6,7 @@
#include "platform/heap/Heap.h"
#include "wtf/Assertions.h"
+#include "wtf/Atomics.h"
#include "wtf/PageAllocator.h"
namespace blink {
@@ -44,6 +45,13 @@ PageMemoryRegion::~PageMemoryRegion()
release();
}
+void PageMemoryRegion::pageDeleted(Address page)
+{
+ markPageUnused(page);
+ if (!atomicDecrement(&m_numPages))
+ delete this;
+}
+
// TODO(haraken): Like partitionOutOfMemoryWithLotsOfUncommitedPages(),
// we should probably have a way to distinguish physical memory OOM from
// virtual address space OOM.
« no previous file with comments | « third_party/WebKit/Source/platform/heap/PageMemory.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698