| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 307 #endif | 307 #endif |
| 308 MAP_PRIVATE, | 308 MAP_PRIVATE, |
| 309 fileno(f), | 309 fileno(f), |
| 310 0); | 310 0); |
| 311 ASSERT(addr != MAP_FAILED); | 311 ASSERT(addr != MAP_FAILED); |
| 312 OS::Free(addr, size); | 312 OS::Free(addr, size); |
| 313 fclose(f); | 313 fclose(f); |
| 314 } | 314 } |
| 315 | 315 |
| 316 | 316 |
| 317 int OS::StackWalk(Vector<OS::StackFrame> frames) { | |
| 318 // backtrace is a glibc extension. | |
| 319 #if defined(__GLIBC__) && !defined(__UCLIBC__) | |
| 320 return POSIXBacktraceHelper<backtrace, backtrace_symbols>::StackWalk(frames); | |
| 321 #else | |
| 322 return 0; | |
| 323 #endif | |
| 324 } | |
| 325 | |
| 326 | |
| 327 // Constants used for mmap. | 317 // Constants used for mmap. |
| 328 static const int kMmapFd = -1; | 318 static const int kMmapFd = -1; |
| 329 static const int kMmapFdOffset = 0; | 319 static const int kMmapFdOffset = 0; |
| 330 | 320 |
| 331 | 321 |
| 332 VirtualMemory::VirtualMemory() : address_(NULL), size_(0) { } | 322 VirtualMemory::VirtualMemory() : address_(NULL), size_(0) { } |
| 333 | 323 |
| 334 | 324 |
| 335 VirtualMemory::VirtualMemory(size_t size) | 325 VirtualMemory::VirtualMemory(size_t size) |
| 336 : address_(ReserveRegion(size)), size_(size) { } | 326 : address_(ReserveRegion(size)), size_(size) { } |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 460 bool VirtualMemory::ReleaseRegion(void* base, size_t size) { | 450 bool VirtualMemory::ReleaseRegion(void* base, size_t size) { |
| 461 return munmap(base, size) == 0; | 451 return munmap(base, size) == 0; |
| 462 } | 452 } |
| 463 | 453 |
| 464 | 454 |
| 465 bool VirtualMemory::HasLazyCommits() { | 455 bool VirtualMemory::HasLazyCommits() { |
| 466 return true; | 456 return true; |
| 467 } | 457 } |
| 468 | 458 |
| 469 } } // namespace v8::internal | 459 } } // namespace v8::internal |
| OLD | NEW |