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 FreeBSD goes here. For the POSIX-compatible | 5 // Platform-specific code for FreeBSD 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 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
239 | 239 |
240 bool VirtualMemory::UncommitRegion(void* base, size_t size) { | 240 bool VirtualMemory::UncommitRegion(void* base, size_t size) { |
241 return mmap(base, | 241 return mmap(base, |
242 size, | 242 size, |
243 PROT_NONE, | 243 PROT_NONE, |
244 MAP_PRIVATE | MAP_ANON | MAP_FIXED, | 244 MAP_PRIVATE | MAP_ANON | MAP_FIXED, |
245 kMmapFd, | 245 kMmapFd, |
246 kMmapFdOffset) != MAP_FAILED; | 246 kMmapFdOffset) != MAP_FAILED; |
247 } | 247 } |
248 | 248 |
| 249 bool VirtualMemory::ReleasePartialRegion(void* base, size_t size, |
| 250 void* free_start, size_t free_size) { |
| 251 return munmap(free_start, free_size) == 0; |
| 252 } |
249 | 253 |
250 bool VirtualMemory::ReleaseRegion(void* base, size_t size) { | 254 bool VirtualMemory::ReleaseRegion(void* base, size_t size) { |
251 return munmap(base, size) == 0; | 255 return munmap(base, size) == 0; |
252 } | 256 } |
253 | 257 |
254 | 258 |
255 bool VirtualMemory::HasLazyCommits() { | 259 bool VirtualMemory::HasLazyCommits() { |
256 // TODO(alph): implement for the platform. | 260 // TODO(alph): implement for the platform. |
257 return false; | 261 return false; |
258 } | 262 } |
259 | 263 |
260 } // namespace base | 264 } // namespace base |
261 } // namespace v8 | 265 } // namespace v8 |
OLD | NEW |