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

Side by Side Diff: src/base/platform/platform-macos.cc

Issue 2032393002: [heap] Uncommit unused large object page memory. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 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
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Platform-specific code for MacOS goes here. For the POSIX-compatible 5 // Platform-specific code for MacOS goes here. For the POSIX-compatible
6 // parts, the implementation is in platform-posix.cc. 6 // parts, the implementation is in platform-posix.cc.
7 7
8 #include <dlfcn.h> 8 #include <dlfcn.h>
9 #include <mach/mach_init.h> 9 #include <mach/mach_init.h>
10 #include <mach-o/dyld.h> 10 #include <mach-o/dyld.h>
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after
232 232
233 bool VirtualMemory::UncommitRegion(void* address, size_t size) { 233 bool VirtualMemory::UncommitRegion(void* address, size_t size) {
234 return mmap(address, 234 return mmap(address,
235 size, 235 size,
236 PROT_NONE, 236 PROT_NONE,
237 MAP_PRIVATE | MAP_ANON | MAP_NORESERVE | MAP_FIXED, 237 MAP_PRIVATE | MAP_ANON | MAP_NORESERVE | MAP_FIXED,
238 kMmapFd, 238 kMmapFd,
239 kMmapFdOffset) != MAP_FAILED; 239 kMmapFdOffset) != MAP_FAILED;
240 } 240 }
241 241
242 bool VirtualMemory::ReleasePartialRegion(void* base, size_t size,
243 void* free_start, size_t free_size) {
244 return munmap(free_start, free_size) == 0;
ulan 2016/06/06 13:44:22 Don't we need to handle lsan like in linux port?
Hannes Payer (out of office) 2016/06/06 14:42:44 We only have it on linux.
245 }
242 246
243 bool VirtualMemory::ReleaseRegion(void* address, size_t size) { 247 bool VirtualMemory::ReleaseRegion(void* address, size_t size) {
244 return munmap(address, size) == 0; 248 return munmap(address, size) == 0;
245 } 249 }
246 250
247 251
248 bool VirtualMemory::HasLazyCommits() { 252 bool VirtualMemory::HasLazyCommits() {
249 return false; 253 return false;
250 } 254 }
251 255
252 } // namespace base 256 } // namespace base
253 } // namespace v8 257 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698