| 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 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 214 void recommitSystemPages(void* addr, size_t len) | 214 void recommitSystemPages(void* addr, size_t len) |
| 215 { | 215 { |
| 216 ASSERT(!(len & kSystemPageOffsetMask)); | 216 ASSERT(!(len & kSystemPageOffsetMask)); |
| 217 #if OS(POSIX) | 217 #if OS(POSIX) |
| 218 (void) addr; | 218 (void) addr; |
| 219 #else | 219 #else |
| 220 RELEASE_ASSERT(setSystemPagesAccessible(addr, len)); | 220 RELEASE_ASSERT(setSystemPagesAccessible(addr, len)); |
| 221 #endif | 221 #endif |
| 222 } | 222 } |
| 223 | 223 |
| 224 void discardSystemPages(void* addr, size_t len) |
| 225 { |
| 226 ASSERT(!(len & kSystemPageOffsetMask)); |
| 227 #if OS(POSIX) |
| 228 // On POSIX, the implementation detail is that discard and decommit are the |
| 229 // same, and lead to pages that are returned to the system immediately and |
| 230 // get replaced with zeroed pages when touched. So we just call |
| 231 // decommitSystemPages() here to avoid code duplication. |
| 232 decommitSystemPages(addr, len); |
| 233 #else |
| 234 (void) addr; |
| 235 (void) len; |
| 236 // TODO(cevans): implement this using MEM_RESET for Windows, once we've |
| 237 // decided that the semantics are a match. |
| 238 #endif |
| 239 } |
| 240 |
| 224 } // namespace WTF | 241 } // namespace WTF |
| 225 | 242 |
| OLD | NEW |