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 OpenBSD and NetBSD goes here. For the | 5 // Platform-specific code for OpenBSD and NetBSD goes here. For the |
6 // POSIX-compatible parts, the implementation is in platform-posix.cc. | 6 // POSIX-compatible 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 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
270 | 270 |
271 bool VirtualMemory::UncommitRegion(void* base, size_t size) { | 271 bool VirtualMemory::UncommitRegion(void* base, size_t size) { |
272 return mmap(base, | 272 return mmap(base, |
273 size, | 273 size, |
274 PROT_NONE, | 274 PROT_NONE, |
275 MAP_PRIVATE | MAP_ANON | MAP_NORESERVE | MAP_FIXED, | 275 MAP_PRIVATE | MAP_ANON | MAP_NORESERVE | MAP_FIXED, |
276 kMmapFd, | 276 kMmapFd, |
277 kMmapFdOffset) != MAP_FAILED; | 277 kMmapFdOffset) != MAP_FAILED; |
278 } | 278 } |
279 | 279 |
| 280 bool VirtualMemory::ReleasePartialRegion(void* base, size_t size, |
| 281 void* free_start, size_t free_size) { |
| 282 return munmap(free_start, free_size) == 0; |
| 283 } |
280 | 284 |
281 bool VirtualMemory::ReleaseRegion(void* base, size_t size) { | 285 bool VirtualMemory::ReleaseRegion(void* base, size_t size) { |
282 return munmap(base, size) == 0; | 286 return munmap(base, size) == 0; |
283 } | 287 } |
284 | 288 |
285 | 289 |
286 bool VirtualMemory::HasLazyCommits() { | 290 bool VirtualMemory::HasLazyCommits() { |
287 // TODO(alph): implement for the platform. | 291 // TODO(alph): implement for the platform. |
288 return false; | 292 return false; |
289 } | 293 } |
290 | 294 |
291 } // namespace base | 295 } // namespace base |
292 } // namespace v8 | 296 } // namespace v8 |
OLD | NEW |