| OLD | NEW |
| 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 17 matching lines...) Expand all Loading... |
| 28 #include <string.h> | 28 #include <string.h> |
| 29 #include <sys/resource.h> | 29 #include <sys/resource.h> |
| 30 #include <sys/sysctl.h> | 30 #include <sys/sysctl.h> |
| 31 #include <sys/time.h> | 31 #include <sys/time.h> |
| 32 #include <sys/types.h> | 32 #include <sys/types.h> |
| 33 | 33 |
| 34 #include <cmath> | 34 #include <cmath> |
| 35 | 35 |
| 36 #undef MAP_TYPE | 36 #undef MAP_TYPE |
| 37 | 37 |
| 38 #include "src/platform.h" | 38 #include "src/base/macros.h" |
| 39 #include "src/utils.h" | 39 #include "src/base/platform/platform.h" |
| 40 | 40 |
| 41 | 41 |
| 42 namespace v8 { | 42 namespace v8 { |
| 43 namespace internal { | 43 namespace base { |
| 44 | 44 |
| 45 | 45 |
| 46 // Constants used for mmap. | 46 // Constants used for mmap. |
| 47 // kMmapFd is used to pass vm_alloc flags to tag the region with the user | 47 // kMmapFd is used to pass vm_alloc flags to tag the region with the user |
| 48 // defined tag 255 This helps identify V8-allocated regions in memory analysis | 48 // defined tag 255 This helps identify V8-allocated regions in memory analysis |
| 49 // tools like vmmap(1). | 49 // tools like vmmap(1). |
| 50 static const int kMmapFd = VM_MAKE_TAG(255); | 50 static const int kMmapFd = VM_MAKE_TAG(255); |
| 51 static const off_t kMmapFdOffset = 0; | 51 static const off_t kMmapFdOffset = 0; |
| 52 | 52 |
| 53 | 53 |
| (...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 300 | 300 |
| 301 bool VirtualMemory::ReleaseRegion(void* address, size_t size) { | 301 bool VirtualMemory::ReleaseRegion(void* address, size_t size) { |
| 302 return munmap(address, size) == 0; | 302 return munmap(address, size) == 0; |
| 303 } | 303 } |
| 304 | 304 |
| 305 | 305 |
| 306 bool VirtualMemory::HasLazyCommits() { | 306 bool VirtualMemory::HasLazyCommits() { |
| 307 return false; | 307 return false; |
| 308 } | 308 } |
| 309 | 309 |
| 310 } } // namespace v8::internal | 310 } } // namespace v8::base |
| OLD | NEW |