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

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

Issue 7324051: Remove heap protection support. (Closed) Base URL: https://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
« no previous file with comments | « src/platform.h ('k') | src/platform-freebsd.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 2006-2011 the V8 project authors. All rights reserved. 1 // Copyright 2006-2011 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 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
159 159
160 160
161 void OS::Free(void* address, const size_t size) { 161 void OS::Free(void* address, const size_t size) {
162 // TODO(1240712): munmap has a return value which is ignored here. 162 // TODO(1240712): munmap has a return value which is ignored here.
163 int result = munmap(address, size); 163 int result = munmap(address, size);
164 USE(result); 164 USE(result);
165 ASSERT(result == 0); 165 ASSERT(result == 0);
166 } 166 }
167 167
168 168
169 #ifdef ENABLE_HEAP_PROTECTION
170
171 void OS::Protect(void* address, size_t size) {
172 // TODO(1240712): mprotect has a return value which is ignored here.
173 mprotect(address, size, PROT_READ);
174 }
175
176
177 void OS::Unprotect(void* address, size_t size, bool is_executable) {
178 // TODO(1240712): mprotect has a return value which is ignored here.
179 int prot = PROT_READ | PROT_WRITE | (is_executable ? PROT_EXEC : 0);
180 mprotect(address, size, prot);
181 }
182
183 #endif
184
185
186 void OS::Sleep(int milliseconds) { 169 void OS::Sleep(int milliseconds) {
187 unsigned int ms = static_cast<unsigned int>(milliseconds); 170 unsigned int ms = static_cast<unsigned int>(milliseconds);
188 usleep(1000 * ms); 171 usleep(1000 * ms);
189 } 172 }
190 173
191 174
192 void OS::Abort() { 175 void OS::Abort() {
193 // Redirect to std abort to signal abnormal program termination. 176 // Redirect to std abort to signal abnormal program termination.
194 abort(); 177 abort();
195 } 178 }
(...skipping 570 matching lines...) Expand 10 before | Expand all | Expand 10 after
766 void Sampler::Stop() { 749 void Sampler::Stop() {
767 ASSERT(IsActive()); 750 ASSERT(IsActive());
768 SamplerThread::RemoveActiveSampler(this); 751 SamplerThread::RemoveActiveSampler(this);
769 SetActive(false); 752 SetActive(false);
770 } 753 }
771 754
772 #endif // ENABLE_LOGGING_AND_PROFILING 755 #endif // ENABLE_LOGGING_AND_PROFILING
773 756
774 } } // namespace v8::internal 757 } } // namespace v8::internal
775 758
OLDNEW
« no previous file with comments | « src/platform.h ('k') | src/platform-freebsd.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698