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

Side by Side Diff: Source/wtf/PageAllocator.cpp

Issue 1184483007: PartitionAlloc: add a discardSystemPages() hint API. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: 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
« Source/wtf/PageAllocator.h ('K') | « Source/wtf/PageAllocator.h ('k') | no next file » | 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 203 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 {
haraken 2015/06/18 18:15:39 Shall we add ASSERT(!(len & kSystemPageOffsetMask)
226 #if OS(POSIX)
227 decommitSystemPages(addr, len);
228 #else
229 (void) addr;
230 (void) len;
231 // TODO(cevans): implement this using MEM_RESET for Windows, once we've
232 // decided that the semantics are a match.
233 #endif
234 }
235
224 } // namespace WTF 236 } // namespace WTF
225 237
OLDNEW
« Source/wtf/PageAllocator.h ('K') | « Source/wtf/PageAllocator.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698