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

Side by Side Diff: third_party/WebKit/Source/wtf/PageAllocator.h

Issue 1666083002: Oilpan: Discard unused system pages when sweeping NormalPageHeaps (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 unified diff | Download patch
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 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 // A read or write to a discarded page will not fault. 119 // A read or write to a discarded page will not fault.
120 // Reading from a discarded page may return the original page content, or a 120 // Reading from a discarded page may return the original page content, or a
121 // page full of zeroes. 121 // page full of zeroes.
122 // Writing to a discarded page is the only guaranteed way to tell the system 122 // Writing to a discarded page is the only guaranteed way to tell the system
123 // that the page is required again. Once written to, the content of the page is 123 // that the page is required again. Once written to, the content of the page is
124 // guaranteed stable once more. After being written to, the page content may be 124 // guaranteed stable once more. After being written to, the page content may be
125 // based on the original page content, or a page of zeroes. 125 // based on the original page content, or a page of zeroes.
126 // len must be a multiple of kSystemPageSize bytes. 126 // len must be a multiple of kSystemPageSize bytes.
127 WTF_EXPORT void discardSystemPages(void* addr, size_t len); 127 WTF_EXPORT void discardSystemPages(void* addr, size_t len);
128 128
129 WTF_EXPORT ALWAYS_INLINE uintptr_t roundUpToSystemPage(uintptr_t address)
130 {
131 return (address + kSystemPageOffsetMask) & kSystemPageBaseMask;
132 }
133
134 WTF_EXPORT ALWAYS_INLINE uintptr_t roundDownToSystemPage(uintptr_t address)
135 {
136 return address & kSystemPageBaseMask;
137 }
138
129 } // namespace WTF 139 } // namespace WTF
130 140
131 #endif // WTF_PageAllocator_h 141 #endif // WTF_PageAllocator_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/platform/testing/RunAllTests.cpp ('k') | third_party/WebKit/Source/wtf/PartitionAlloc.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698