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

Side by Side Diff: src/platform-macos.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 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
162 162
163 163
164 void OS::Free(void* address, const size_t size) { 164 void OS::Free(void* address, const size_t size) {
165 // TODO(1240712): munmap has a return value which is ignored here. 165 // TODO(1240712): munmap has a return value which is ignored here.
166 int result = munmap(address, size); 166 int result = munmap(address, size);
167 USE(result); 167 USE(result);
168 ASSERT(result == 0); 168 ASSERT(result == 0);
169 } 169 }
170 170
171 171
172 void OS::Guard(void* address, const size_t size) {
173 mprotect(address, size, PROT_NONE);
174 }
175
176
172 void OS::Sleep(int milliseconds) { 177 void OS::Sleep(int milliseconds) {
173 usleep(1000 * milliseconds); 178 usleep(1000 * milliseconds);
174 } 179 }
175 180
176 181
177 void OS::Abort() { 182 void OS::Abort() {
178 // Redirect to std abort to signal abnormal program termination 183 // Redirect to std abort to signal abnormal program termination
179 abort(); 184 abort();
180 } 185 }
181 186
(...skipping 616 matching lines...) Expand 10 before | Expand all | Expand 10 after
798 803
799 804
800 void Sampler::Stop() { 805 void Sampler::Stop() {
801 ASSERT(IsActive()); 806 ASSERT(IsActive());
802 SamplerThread::RemoveActiveSampler(this); 807 SamplerThread::RemoveActiveSampler(this);
803 SetActive(false); 808 SetActive(false);
804 } 809 }
805 810
806 811
807 } } // namespace v8::internal 812 } } // namespace v8::internal
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698