OLD | NEW |
---|---|
1 // Copyright 2006-2011 the V8 project authors. All rights reserved. | 1 // Copyright 2006-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 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
159 | 159 |
160 | 160 |
161 void OS::Free(void* address, const size_t size) { | 161 void OS::Free(void* address, const size_t size) { |
162 // TODO(1240712): munmap has a return value which is ignored here. | 162 // TODO(1240712): munmap has a return value which is ignored here. |
163 int result = munmap(address, size); | 163 int result = munmap(address, size); |
164 USE(result); | 164 USE(result); |
165 ASSERT(result == 0); | 165 ASSERT(result == 0); |
166 } | 166 } |
167 | 167 |
168 | 168 |
169 void OS::Guard(void* address, const size_t size) { | |
170 mprotect(address, size, PROT_NONE); | |
Mads Ager (chromium)
2011/07/17 09:47:53
Instead of having identical code in all of these p
Cris Neckar
2011/07/18 23:55:12
Done.
| |
171 } | |
172 | |
173 | |
169 void OS::Sleep(int milliseconds) { | 174 void OS::Sleep(int milliseconds) { |
170 unsigned int ms = static_cast<unsigned int>(milliseconds); | 175 unsigned int ms = static_cast<unsigned int>(milliseconds); |
171 usleep(1000 * ms); | 176 usleep(1000 * ms); |
172 } | 177 } |
173 | 178 |
174 | 179 |
175 void OS::Abort() { | 180 void OS::Abort() { |
176 // Redirect to std abort to signal abnormal program termination. | 181 // Redirect to std abort to signal abnormal program termination. |
177 abort(); | 182 abort(); |
178 } | 183 } |
(...skipping 564 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
743 | 748 |
744 | 749 |
745 void Sampler::Stop() { | 750 void Sampler::Stop() { |
746 ASSERT(IsActive()); | 751 ASSERT(IsActive()); |
747 SamplerThread::RemoveActiveSampler(this); | 752 SamplerThread::RemoveActiveSampler(this); |
748 SetActive(false); | 753 SetActive(false); |
749 } | 754 } |
750 | 755 |
751 | 756 |
752 } } // namespace v8::internal | 757 } } // namespace v8::internal |
OLD | NEW |