OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 372 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
383 | 383 |
384 | 384 |
385 void OS::Free(void* address, const size_t size) { | 385 void OS::Free(void* address, const size_t size) { |
386 // TODO(1240712): munmap has a return value which is ignored here. | 386 // TODO(1240712): munmap has a return value which is ignored here. |
387 int result = munmap(address, size); | 387 int result = munmap(address, size); |
388 USE(result); | 388 USE(result); |
389 ASSERT(result == 0); | 389 ASSERT(result == 0); |
390 } | 390 } |
391 | 391 |
392 | 392 |
| 393 void OS::Guard(void* address, const size_t size) { |
| 394 mprotect(address, size, PROT_NONE); |
| 395 } |
| 396 |
| 397 |
393 void OS::Sleep(int milliseconds) { | 398 void OS::Sleep(int milliseconds) { |
394 unsigned int ms = static_cast<unsigned int>(milliseconds); | 399 unsigned int ms = static_cast<unsigned int>(milliseconds); |
395 usleep(1000 * ms); | 400 usleep(1000 * ms); |
396 } | 401 } |
397 | 402 |
398 | 403 |
399 void OS::Abort() { | 404 void OS::Abort() { |
400 // Redirect to std abort to signal abnormal program termination. | 405 // Redirect to std abort to signal abnormal program termination. |
401 abort(); | 406 abort(); |
402 } | 407 } |
(...skipping 717 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1120 | 1125 |
1121 | 1126 |
1122 void Sampler::Stop() { | 1127 void Sampler::Stop() { |
1123 ASSERT(IsActive()); | 1128 ASSERT(IsActive()); |
1124 SignalSender::RemoveActiveSampler(this); | 1129 SignalSender::RemoveActiveSampler(this); |
1125 SetActive(false); | 1130 SetActive(false); |
1126 } | 1131 } |
1127 | 1132 |
1128 | 1133 |
1129 } } // namespace v8::internal | 1134 } } // namespace v8::internal |
OLD | NEW |