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 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
145 #else | 145 #else |
146 mprotect(address, size, PROT_READ | PROT_EXEC); | 146 mprotect(address, size, PROT_READ | PROT_EXEC); |
147 #endif | 147 #endif |
148 } | 148 } |
149 | 149 |
150 | 150 |
151 // Create guard pages. | 151 // Create guard pages. |
152 void OS::Guard(void* address, const size_t size) { | 152 void OS::Guard(void* address, const size_t size) { |
153 #if defined(__CYGWIN__) | 153 #if defined(__CYGWIN__) |
154 DWORD oldprotect; | 154 DWORD oldprotect; |
155 VirtualProtect(address, size, PAGE_READONLY | PAGE_GUARD, &oldprotect); | 155 VirtualProtect(address, size, PAGE_NOACCESS, &oldprotect); |
156 #else | 156 #else |
157 mprotect(address, size, PROT_NONE); | 157 mprotect(address, size, PROT_NONE); |
158 #endif | 158 #endif |
159 } | 159 } |
160 | 160 |
161 | 161 |
162 void* OS::GetRandomMmapAddr() { | 162 void* OS::GetRandomMmapAddr() { |
163 #if defined(__native_client__) | 163 #if defined(__native_client__) |
164 // TODO(bradchen): restore randomization once Native Client gets | 164 // TODO(bradchen): restore randomization once Native Client gets |
165 // smarter about using mmap address hints. | 165 // smarter about using mmap address hints. |
(...skipping 567 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
733 | 733 |
734 void Thread::SetThreadLocal(LocalStorageKey key, void* value) { | 734 void Thread::SetThreadLocal(LocalStorageKey key, void* value) { |
735 pthread_key_t pthread_key = LocalKeyToPthreadKey(key); | 735 pthread_key_t pthread_key = LocalKeyToPthreadKey(key); |
736 int result = pthread_setspecific(pthread_key, value); | 736 int result = pthread_setspecific(pthread_key, value); |
737 ASSERT_EQ(0, result); | 737 ASSERT_EQ(0, result); |
738 USE(result); | 738 USE(result); |
739 } | 739 } |
740 | 740 |
741 | 741 |
742 } } // namespace v8::internal | 742 } } // namespace v8::internal |
OLD | NEW |