Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(223)

Side by Side Diff: src/base/platform/platform-win32.cc

Issue 2396433008: [wasm] Add guard regions to end of WebAssembly.Memory buffers (Closed)
Patch Set: Cleanup Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 803 matching lines...) Expand 10 before | Expand all | Expand 10 after
814 DWORD old_protect; 814 DWORD old_protect;
815 VirtualProtect(address, size, PAGE_EXECUTE_READ, &old_protect); 815 VirtualProtect(address, size, PAGE_EXECUTE_READ, &old_protect);
816 } 816 }
817 817
818 818
819 void OS::Guard(void* address, const size_t size) { 819 void OS::Guard(void* address, const size_t size) {
820 DWORD oldprotect; 820 DWORD oldprotect;
821 VirtualProtect(address, size, PAGE_NOACCESS, &oldprotect); 821 VirtualProtect(address, size, PAGE_NOACCESS, &oldprotect);
822 } 822 }
823 823
824 void OS::Unprotect(void* address, const size_t size) {
825 DWORD oldprotect;
826 VirtualProtect(address, size, PAGE_READWRITE, &oldprotect);
827 }
824 828
825 void OS::Sleep(TimeDelta interval) { 829 void OS::Sleep(TimeDelta interval) {
826 ::Sleep(static_cast<DWORD>(interval.InMilliseconds())); 830 ::Sleep(static_cast<DWORD>(interval.InMilliseconds()));
827 } 831 }
828 832
829 833
830 void OS::Abort() { 834 void OS::Abort() {
831 if (g_hard_abort) { 835 if (g_hard_abort) {
832 V8_IMMEDIATE_CRASH(); 836 V8_IMMEDIATE_CRASH();
833 } 837 }
(...skipping 562 matching lines...) Expand 10 before | Expand all | Expand 10 after
1396 1400
1397 1401
1398 void Thread::SetThreadLocal(LocalStorageKey key, void* value) { 1402 void Thread::SetThreadLocal(LocalStorageKey key, void* value) {
1399 BOOL result = TlsSetValue(static_cast<DWORD>(key), value); 1403 BOOL result = TlsSetValue(static_cast<DWORD>(key), value);
1400 USE(result); 1404 USE(result);
1401 DCHECK(result); 1405 DCHECK(result);
1402 } 1406 }
1403 1407
1404 } // namespace base 1408 } // namespace base
1405 } // namespace v8 1409 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698