| OLD | NEW |
| 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 Loading... |
| 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 |
| OLD | NEW |