OLD | NEW |
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 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 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
162 | 162 |
163 | 163 |
164 void OS::Free(void* address, const size_t size) { | 164 void OS::Free(void* address, const size_t size) { |
165 // TODO(1240712): munmap has a return value which is ignored here. | 165 // TODO(1240712): munmap has a return value which is ignored here. |
166 int result = munmap(address, size); | 166 int result = munmap(address, size); |
167 USE(result); | 167 USE(result); |
168 ASSERT(result == 0); | 168 ASSERT(result == 0); |
169 } | 169 } |
170 | 170 |
171 | 171 |
| 172 void OS::Guard(void* address, const size_t size) { |
| 173 mprotect(address, size, PROT_NONE); |
| 174 } |
| 175 |
| 176 |
172 void OS::Sleep(int milliseconds) { | 177 void OS::Sleep(int milliseconds) { |
173 usleep(1000 * milliseconds); | 178 usleep(1000 * milliseconds); |
174 } | 179 } |
175 | 180 |
176 | 181 |
177 void OS::Abort() { | 182 void OS::Abort() { |
178 // Redirect to std abort to signal abnormal program termination | 183 // Redirect to std abort to signal abnormal program termination |
179 abort(); | 184 abort(); |
180 } | 185 } |
181 | 186 |
(...skipping 616 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
798 | 803 |
799 | 804 |
800 void Sampler::Stop() { | 805 void Sampler::Stop() { |
801 ASSERT(IsActive()); | 806 ASSERT(IsActive()); |
802 SamplerThread::RemoveActiveSampler(this); | 807 SamplerThread::RemoveActiveSampler(this); |
803 SetActive(false); | 808 SetActive(false); |
804 } | 809 } |
805 | 810 |
806 | 811 |
807 } } // namespace v8::internal | 812 } } // namespace v8::internal |
OLD | NEW |