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

Unified Diff: Source/wtf/PageAllocator.h

Issue 1184483007: PartitionAlloc: add a discardSystemPages() hint API. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 6 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 | Source/wtf/PageAllocator.cpp » ('j') | Source/wtf/PageAllocator.cpp » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/wtf/PageAllocator.h
diff --git a/Source/wtf/PageAllocator.h b/Source/wtf/PageAllocator.h
index bcde4e24a44c92d8f41a1ed4b39ae4e9e0654f77..dbecc0586a630325f023bc6a2771af9734e062b3 100644
--- a/Source/wtf/PageAllocator.h
+++ b/Source/wtf/PageAllocator.h
@@ -107,6 +107,23 @@ WTF_EXPORT void decommitSystemPages(void* addr, size_t len);
// len must be a multiple of kSystemPageSize bytes.
WTF_EXPORT void recommitSystemPages(void* addr, size_t len);
+// Discard one or more system pages. Discarding is a hint to the system that
+// the page is no longer required. The hint may:
+// - Do nothing.
+// - Discard the page immediately, freeing up physical pages.
+// - Discard the page at some time in the future in response to memory pressure.
+// Only committed pages should be discarded. Discarding a page does not
+// decommit it, and it is valid to discard an already-discarded page.
haraken 2015/06/18 18:15:40 I'm a bit confused with "Discarding a page does no
+// A read or write to a discarded page will not fault.
haraken 2015/06/18 18:15:40 Given that you call decommitSystemPages, I guess a
+// Reading from a discarded page may return the original page content, or a
+// page full of zeroes.
+// Writing to a discarded page is the only guaranteed way to undo the effect of
haraken 2015/06/18 18:15:40 "undo the effect of discarding it" might be a bit
+// discarding it. Once written to, the content of the page is guaranteed stable
+// again. After being written to, the page content may be based on the original
+// page content, or a page of zeroes.
+// len must be a multiple of kSystemPageSize bytes.
+WTF_EXPORT void discardSystemPages(void* addr, size_t len);
+
} // namespace WTF
#endif // WTF_PageAllocator_h
« no previous file with comments | « no previous file | Source/wtf/PageAllocator.cpp » ('j') | Source/wtf/PageAllocator.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698