OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // Platform-specific code for Win32. | 5 // Platform-specific code for Win32. |
6 | 6 |
7 // Secure API functions are not available using MinGW with msvcrt.dll | 7 // Secure API functions are not available using MinGW with msvcrt.dll |
8 // on Windows XP. Make sure MINGW_HAS_SECURE_API is not defined to | 8 // on Windows XP. Make sure MINGW_HAS_SECURE_API is not defined to |
9 // disable definition of secure API functions in standard headers that | 9 // disable definition of secure API functions in standard headers that |
10 // would conflict with our own implementation. | 10 // would conflict with our own implementation. |
(...skipping 798 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
809 | 809 |
810 | 810 |
811 void OS::Guard(void* address, const size_t size) { | 811 void OS::Guard(void* address, const size_t size) { |
812 DWORD oldprotect; | 812 DWORD oldprotect; |
813 VirtualProtect(address, size, PAGE_NOACCESS, &oldprotect); | 813 VirtualProtect(address, size, PAGE_NOACCESS, &oldprotect); |
814 } | 814 } |
815 | 815 |
816 void OS::Unprotect(void* address, const size_t size) { | 816 void OS::Unprotect(void* address, const size_t size) { |
817 LPVOID result = VirtualAlloc(address, size, MEM_COMMIT, PAGE_READWRITE); | 817 LPVOID result = VirtualAlloc(address, size, MEM_COMMIT, PAGE_READWRITE); |
818 DCHECK_IMPLIES(result != nullptr, GetLastError() == 0); | 818 DCHECK_IMPLIES(result != nullptr, GetLastError() == 0); |
| 819 USE(result); |
819 } | 820 } |
820 | 821 |
821 void OS::Sleep(TimeDelta interval) { | 822 void OS::Sleep(TimeDelta interval) { |
822 ::Sleep(static_cast<DWORD>(interval.InMilliseconds())); | 823 ::Sleep(static_cast<DWORD>(interval.InMilliseconds())); |
823 } | 824 } |
824 | 825 |
825 | 826 |
826 void OS::Abort() { | 827 void OS::Abort() { |
827 if (g_hard_abort) { | 828 if (g_hard_abort) { |
828 V8_IMMEDIATE_CRASH(); | 829 V8_IMMEDIATE_CRASH(); |
(...skipping 563 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1392 | 1393 |
1393 | 1394 |
1394 void Thread::SetThreadLocal(LocalStorageKey key, void* value) { | 1395 void Thread::SetThreadLocal(LocalStorageKey key, void* value) { |
1395 BOOL result = TlsSetValue(static_cast<DWORD>(key), value); | 1396 BOOL result = TlsSetValue(static_cast<DWORD>(key), value); |
1396 USE(result); | 1397 USE(result); |
1397 DCHECK(result); | 1398 DCHECK(result); |
1398 } | 1399 } |
1399 | 1400 |
1400 } // namespace base | 1401 } // namespace base |
1401 } // namespace v8 | 1402 } // namespace v8 |
OLD | NEW |