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

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

Issue 23458022: Use PAGE_NOACCESS for guard pages in Windows. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 3 months 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 | Annotate | Revision Log
« no previous file with comments | « src/platform-posix.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 879 matching lines...) Expand 10 before | Expand all | Expand 10 after
890 890
891 891
892 void OS::ProtectCode(void* address, const size_t size) { 892 void OS::ProtectCode(void* address, const size_t size) {
893 DWORD old_protect; 893 DWORD old_protect;
894 VirtualProtect(address, size, PAGE_EXECUTE_READ, &old_protect); 894 VirtualProtect(address, size, PAGE_EXECUTE_READ, &old_protect);
895 } 895 }
896 896
897 897
898 void OS::Guard(void* address, const size_t size) { 898 void OS::Guard(void* address, const size_t size) {
899 DWORD oldprotect; 899 DWORD oldprotect;
900 VirtualProtect(address, size, PAGE_READONLY | PAGE_GUARD, &oldprotect); 900 VirtualProtect(address, size, PAGE_NOACCESS, &oldprotect);
901 } 901 }
902 902
903 903
904 void OS::Sleep(int milliseconds) { 904 void OS::Sleep(int milliseconds) {
905 ::Sleep(milliseconds); 905 ::Sleep(milliseconds);
906 } 906 }
907 907
908 908
909 void OS::Abort() { 909 void OS::Abort() {
910 if (IsDebuggerPresent() || FLAG_break_on_abort) { 910 if (IsDebuggerPresent() || FLAG_break_on_abort) {
(...skipping 555 matching lines...) Expand 10 before | Expand all | Expand 10 after
1466 bool VirtualMemory::Uncommit(void* address, size_t size) { 1466 bool VirtualMemory::Uncommit(void* address, size_t size) {
1467 ASSERT(IsReserved()); 1467 ASSERT(IsReserved());
1468 return UncommitRegion(address, size); 1468 return UncommitRegion(address, size);
1469 } 1469 }
1470 1470
1471 1471
1472 bool VirtualMemory::Guard(void* address) { 1472 bool VirtualMemory::Guard(void* address) {
1473 if (NULL == VirtualAlloc(address, 1473 if (NULL == VirtualAlloc(address,
1474 OS::CommitPageSize(), 1474 OS::CommitPageSize(),
1475 MEM_COMMIT, 1475 MEM_COMMIT,
1476 PAGE_READONLY | PAGE_GUARD)) { 1476 PAGE_NOACCESS)) {
1477 return false; 1477 return false;
1478 } 1478 }
1479 return true; 1479 return true;
1480 } 1480 }
1481 1481
1482 1482
1483 void* VirtualMemory::ReserveRegion(size_t size) { 1483 void* VirtualMemory::ReserveRegion(size_t size) {
1484 return RandomizedVirtualAlloc(size, MEM_RESERVE, PAGE_NOACCESS); 1484 return RandomizedVirtualAlloc(size, MEM_RESERVE, PAGE_NOACCESS);
1485 } 1485 }
1486 1486
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
1626 limit_mutex = new Mutex(); 1626 limit_mutex = new Mutex();
1627 } 1627 }
1628 1628
1629 1629
1630 void OS::TearDown() { 1630 void OS::TearDown() {
1631 delete limit_mutex; 1631 delete limit_mutex;
1632 } 1632 }
1633 1633
1634 1634
1635 } } // namespace v8::internal 1635 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/platform-posix.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698