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 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
205 | 205 |
206 | 206 |
207 VirtualMemory::~VirtualMemory() { | 207 VirtualMemory::~VirtualMemory() { |
208 if (IsReserved()) { | 208 if (IsReserved()) { |
209 bool result = ReleaseRegion(address(), size()); | 209 bool result = ReleaseRegion(address(), size()); |
210 DCHECK(result); | 210 DCHECK(result); |
211 USE(result); | 211 USE(result); |
212 } | 212 } |
213 } | 213 } |
214 | 214 |
215 | 215 bool VirtualMemory::IsReserved() const { return address_ != NULL; } |
216 bool VirtualMemory::IsReserved() { | |
217 return address_ != NULL; | |
218 } | |
219 | |
220 | 216 |
221 void VirtualMemory::Reset() { | 217 void VirtualMemory::Reset() { |
222 address_ = NULL; | 218 address_ = NULL; |
223 size_ = 0; | 219 size_ = 0; |
224 } | 220 } |
225 | 221 |
226 | 222 |
227 bool VirtualMemory::Commit(void* address, size_t size, bool is_executable) { | 223 bool VirtualMemory::Commit(void* address, size_t size, bool is_executable) { |
228 return CommitRegion(address, size, is_executable); | 224 return CommitRegion(address, size, is_executable); |
229 } | 225 } |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
287 } | 283 } |
288 | 284 |
289 | 285 |
290 bool VirtualMemory::HasLazyCommits() { | 286 bool VirtualMemory::HasLazyCommits() { |
291 // TODO(alph): implement for the platform. | 287 // TODO(alph): implement for the platform. |
292 return false; | 288 return false; |
293 } | 289 } |
294 | 290 |
295 } // namespace base | 291 } // namespace base |
296 } // namespace v8 | 292 } // namespace v8 |
OLD | NEW |