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

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

Issue 2109943003: [heap] Reland uncommit unused large object page memory. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: fix Created 4 years, 5 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
« no previous file with comments | « src/base/platform/platform.h ('k') | src/base/platform/platform-macos.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 Linux goes here. For the POSIX-compatible 5 // Platform-specific code for Linux 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 <pthread.h> 8 #include <pthread.h>
9 #include <semaphore.h> 9 #include <semaphore.h>
10 #include <signal.h> 10 #include <signal.h>
(...skipping 357 matching lines...) Expand 10 before | Expand all | Expand 10 after
368 368
369 bool VirtualMemory::UncommitRegion(void* base, size_t size) { 369 bool VirtualMemory::UncommitRegion(void* base, size_t size) {
370 return mmap(base, 370 return mmap(base,
371 size, 371 size,
372 PROT_NONE, 372 PROT_NONE,
373 MAP_PRIVATE | MAP_ANONYMOUS | MAP_NORESERVE | MAP_FIXED, 373 MAP_PRIVATE | MAP_ANONYMOUS | MAP_NORESERVE | MAP_FIXED,
374 kMmapFd, 374 kMmapFd,
375 kMmapFdOffset) != MAP_FAILED; 375 kMmapFdOffset) != MAP_FAILED;
376 } 376 }
377 377
378 bool VirtualMemory::ReleasePartialRegion(void* base, size_t size,
379 void* free_start, size_t free_size) {
380 #if defined(LEAK_SANITIZER)
381 __lsan_unregister_root_region(base, size);
382 __lsan_register_root_region(base, size - free_size);
383 #endif
384 return munmap(free_start, free_size) == 0;
385 }
378 386
379 bool VirtualMemory::ReleaseRegion(void* base, size_t size) { 387 bool VirtualMemory::ReleaseRegion(void* base, size_t size) {
380 #if defined(LEAK_SANITIZER) 388 #if defined(LEAK_SANITIZER)
381 __lsan_unregister_root_region(base, size); 389 __lsan_unregister_root_region(base, size);
382 #endif 390 #endif
383 return munmap(base, size) == 0; 391 return munmap(base, size) == 0;
384 } 392 }
385 393
386 394
387 bool VirtualMemory::HasLazyCommits() { 395 bool VirtualMemory::HasLazyCommits() {
388 return true; 396 return true;
389 } 397 }
390 398
391 } // namespace base 399 } // namespace base
392 } // namespace v8 400 } // namespace v8
OLDNEW
« no previous file with comments | « src/base/platform/platform.h ('k') | src/base/platform/platform-macos.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698