Commit 79e54681 authored by ruuda@google.com's avatar ruuda@google.com

Clean up and clarify PartitionAlloc

A partition page is not ‘typically’ 16 kB, it is always defined to be 16 kB.
Also drive-by fixes for line wrapping and typos.

Review URL: https://codereview.chromium.org/1323093004

git-svn-id: svn://svn.chromium.org/blink/trunk@201720 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 7342cb45
......@@ -97,8 +97,9 @@ WTF_EXPORT WARN_UNUSED_RETURN bool setSystemPagesAccessible(void* addr, size_t l
// Clients should not make any assumptions about the contents of decommitted
// system pages, before or after they write to the page. The only guarantee
// provided is that the contents of the system page will be deterministic again
// after recommitting and writing to it. In particlar note that system pages are// not guaranteed to be zero-filled upon re-commit.
// len must be a multiple of kSystemPageSize bytes.
// after recommitting and writing to it. In particlar note that system pages are
// not guaranteed to be zero-filled upon re-commit. len must be a multiple of
// kSystemPageSize bytes.
WTF_EXPORT void decommitSystemPages(void* addr, size_t len);
// Recommit one or more system pages. Decommitted system pages must be
......@@ -118,7 +119,8 @@ WTF_EXPORT void recommitSystemPages(void* addr, size_t len);
// 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 tell the system
// that the page is required again. Once written to, the content of the page is // guaranteed stable once more. After being written to, the page content may be
// that the page is required again. Once written to, the content of the page is
// guaranteed stable once more. 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);
......
......@@ -141,10 +141,10 @@ static const size_t kMaxPartitionPagesPerSlotSpan = 4;
// To avoid fragmentation via never-used freelist entries, we hand out partition
// freelist sections gradually, in units of the dominant system page size.
// What we're actually doing is avoiding filling the full partition page
// (typically 16KB) will freelist pointers right away. Writing freelist
// pointers will fault and dirty a private page, which is very wasteful if we
// never actually store objects there.
// What we're actually doing is avoiding filling the full partition page (16 KB)
// with freelist pointers right away. Writing freelist pointers will fault and
// dirty a private page, which is very wasteful if we never actually store
// objects there.
static const size_t kNumSystemPagesPerPartitionPage = kPartitionPageSize / kSystemPageSize;
static const size_t kMaxSystemPagesPerSlotSpan = kNumSystemPagesPerPartitionPage * kMaxPartitionPagesPerSlotSpan;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment