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

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

Issue 7379004: Add guard pages in front of platform allocations (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 9 years, 5 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
OLDNEW
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. 1 // Copyright 2006-2008 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 939 matching lines...) Expand 10 before | Expand all | Expand 10 after
950 } 950 }
951 951
952 952
953 void OS::Free(void* address, const size_t size) { 953 void OS::Free(void* address, const size_t size) {
954 // TODO(1240712): VirtualFree has a return value which is ignored here. 954 // TODO(1240712): VirtualFree has a return value which is ignored here.
955 VirtualFree(address, 0, MEM_RELEASE); 955 VirtualFree(address, 0, MEM_RELEASE);
956 USE(size); 956 USE(size);
957 } 957 }
958 958
959 959
960 void OS::Guard(void* address, const size_t size) {
961 DWORD oldprotect;
962 VirtualProtect(address, size, PAGE_READONLY | PAGE_GUARD, &oldprotect);
963 }
964
965
960 void OS::Sleep(int milliseconds) { 966 void OS::Sleep(int milliseconds) {
961 ::Sleep(milliseconds); 967 ::Sleep(milliseconds);
962 } 968 }
963 969
964 970
965 void OS::Abort() { 971 void OS::Abort() {
966 if (!IsDebuggerPresent()) { 972 if (!IsDebuggerPresent()) {
967 #ifdef _MSC_VER 973 #ifdef _MSC_VER
968 // Make the MSVCRT do a silent abort. 974 // Make the MSVCRT do a silent abort.
969 _set_abort_behavior(0, _WRITE_ABORT_MSG); 975 _set_abort_behavior(0, _WRITE_ABORT_MSG);
(...skipping 1056 matching lines...) Expand 10 before | Expand all | Expand 10 after
2026 2032
2027 2033
2028 void Sampler::Stop() { 2034 void Sampler::Stop() {
2029 ASSERT(IsActive()); 2035 ASSERT(IsActive());
2030 SamplerThread::RemoveActiveSampler(this); 2036 SamplerThread::RemoveActiveSampler(this);
2031 SetActive(false); 2037 SetActive(false);
2032 } 2038 }
2033 2039
2034 2040
2035 } } // namespace v8::internal 2041 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/platform-posix.cc ('k') | src/spaces.h » ('j') | src/spaces.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698