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

Side by Side 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: Review feedback. 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 unified diff | Download patch
« no previous file with comments | « no previous file | Source/wtf/PageAllocator.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 // after recommitting and writing to it. In particlar note that system pages are // not guaranteed to be zero-filled upon re-commit. 100 // after recommitting and writing to it. In particlar note that system pages are // not guaranteed to be zero-filled upon re-commit.
101 // len must be a multiple of kSystemPageSize bytes. 101 // len must be a multiple of kSystemPageSize bytes.
102 WTF_EXPORT void decommitSystemPages(void* addr, size_t len); 102 WTF_EXPORT void decommitSystemPages(void* addr, size_t len);
103 103
104 // Recommit one or more system pages. Decommitted system pages must be 104 // Recommit one or more system pages. Decommitted system pages must be
105 // recommitted before they are read are written again. 105 // recommitted before they are read are written again.
106 // Note that this operation may be a no-op on some platforms. 106 // Note that this operation may be a no-op on some platforms.
107 // len must be a multiple of kSystemPageSize bytes. 107 // len must be a multiple of kSystemPageSize bytes.
108 WTF_EXPORT void recommitSystemPages(void* addr, size_t len); 108 WTF_EXPORT void recommitSystemPages(void* addr, size_t len);
109 109
110 // Discard one or more system pages. Discarding is a hint to the system that
111 // the page is no longer required. The hint may:
112 // - Do nothing.
113 // - Discard the page immediately, freeing up physical pages.
114 // - Discard the page at some time in the future in response to memory pressure.
115 // Only committed pages should be discarded. Discarding a page does not
116 // decommit it, and it is valid to discard an already-discarded page.
117 // A read or write to a discarded page will not fault.
118 // Reading from a discarded page may return the original page content, or a
119 // page full of zeroes.
120 // Writing to a discarded page is the only guaranteed way to tell the system
121 // 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
122 // based on the original page content, or a page of zeroes.
123 // len must be a multiple of kSystemPageSize bytes.
124 WTF_EXPORT void discardSystemPages(void* addr, size_t len);
125
110 } // namespace WTF 126 } // namespace WTF
111 127
112 #endif // WTF_PageAllocator_h 128 #endif // WTF_PageAllocator_h
OLDNEW
« no previous file with comments | « no previous file | Source/wtf/PageAllocator.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698