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 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
185 | 185 |
186 | 186 |
187 void OS::Free(void* address, const size_t size) { | 187 void OS::Free(void* address, const size_t size) { |
188 // TODO(1240712): munmap has a return value which is ignored here. | 188 // TODO(1240712): munmap has a return value which is ignored here. |
189 int result = munmap(address, size); | 189 int result = munmap(address, size); |
190 USE(result); | 190 USE(result); |
191 ASSERT(result == 0); | 191 ASSERT(result == 0); |
192 } | 192 } |
193 | 193 |
194 | 194 |
| 195 void OS::Guard(void* address, const size_t size) { |
| 196 mprotect(address, size, PROT_NONE); |
| 197 } |
| 198 |
| 199 |
195 void OS::Sleep(int milliseconds) { | 200 void OS::Sleep(int milliseconds) { |
196 useconds_t ms = static_cast<useconds_t>(milliseconds); | 201 useconds_t ms = static_cast<useconds_t>(milliseconds); |
197 usleep(1000 * ms); | 202 usleep(1000 * ms); |
198 } | 203 } |
199 | 204 |
200 | 205 |
201 void OS::Abort() { | 206 void OS::Abort() { |
202 // Redirect to std abort to signal abnormal program termination. | 207 // Redirect to std abort to signal abnormal program termination. |
203 abort(); | 208 abort(); |
204 } | 209 } |
(...skipping 587 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
792 } | 797 } |
793 | 798 |
794 | 799 |
795 void Sampler::Stop() { | 800 void Sampler::Stop() { |
796 ASSERT(IsActive()); | 801 ASSERT(IsActive()); |
797 SignalSender::RemoveActiveSampler(this); | 802 SignalSender::RemoveActiveSampler(this); |
798 SetActive(false); | 803 SetActive(false); |
799 } | 804 } |
800 | 805 |
801 } } // namespace v8::internal | 806 } } // namespace v8::internal |
OLD | NEW |