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

Side by Side Diff: src/platform-posix.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-cygwin.cc ('k') | src/platform-win32.cc » ('j') | 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 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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
OLDNEW
« no previous file with comments | « src/platform-cygwin.cc ('k') | src/platform-win32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698