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

Side by Side Diff: src/platform-freebsd.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 163 matching lines...) Expand 10 before | Expand all | Expand 10 after
174 174
175 175
176 void OS::Free(void* buf, const size_t length) { 176 void OS::Free(void* buf, const size_t length) {
177 // TODO(1240712): munmap has a return value which is ignored here. 177 // TODO(1240712): munmap has a return value which is ignored here.
178 int result = munmap(buf, length); 178 int result = munmap(buf, length);
179 USE(result); 179 USE(result);
180 ASSERT(result == 0); 180 ASSERT(result == 0);
181 } 181 }
182 182
183 183
184 void OS::Guard(void* address, const size_t size) {
185 mprotect(address, size, PROT_NONE);
186 }
187
188
184 void OS::Sleep(int milliseconds) { 189 void OS::Sleep(int milliseconds) {
185 unsigned int ms = static_cast<unsigned int>(milliseconds); 190 unsigned int ms = static_cast<unsigned int>(milliseconds);
186 usleep(1000 * ms); 191 usleep(1000 * ms);
187 } 192 }
188 193
189 194
190 void OS::Abort() { 195 void OS::Abort() {
191 // Redirect to std abort to signal abnormal program termination. 196 // Redirect to std abort to signal abnormal program termination.
192 abort(); 197 abort();
193 } 198 }
(...skipping 598 matching lines...) Expand 10 before | Expand all | Expand 10 after
792 797
793 798
794 void Sampler::Stop() { 799 void Sampler::Stop() {
795 ASSERT(IsActive()); 800 ASSERT(IsActive());
796 SignalSender::RemoveActiveSampler(this); 801 SignalSender::RemoveActiveSampler(this);
797 SetActive(false); 802 SetActive(false);
798 } 803 }
799 804
800 805
801 } } // namespace v8::internal 806 } } // namespace v8::internal
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698