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

Side by Side Diff: src/platform-linux.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-freebsd.cc ('k') | src/platform-macos.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 2011 the V8 project authors. All rights reserved. 1 // Copyright 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 372 matching lines...) Expand 10 before | Expand all | Expand 10 after
383 383
384 384
385 void OS::Free(void* address, const size_t size) { 385 void OS::Free(void* address, const size_t size) {
386 // TODO(1240712): munmap has a return value which is ignored here. 386 // TODO(1240712): munmap has a return value which is ignored here.
387 int result = munmap(address, size); 387 int result = munmap(address, size);
388 USE(result); 388 USE(result);
389 ASSERT(result == 0); 389 ASSERT(result == 0);
390 } 390 }
391 391
392 392
393 #ifdef ENABLE_HEAP_PROTECTION
394
395 void OS::Protect(void* address, size_t size) {
396 // TODO(1240712): mprotect has a return value which is ignored here.
397 mprotect(address, size, PROT_READ);
398 }
399
400
401 void OS::Unprotect(void* address, size_t size, bool is_executable) {
402 // TODO(1240712): mprotect has a return value which is ignored here.
403 int prot = PROT_READ | PROT_WRITE | (is_executable ? PROT_EXEC : 0);
404 mprotect(address, size, prot);
405 }
406
407 #endif
408
409
410 void OS::Sleep(int milliseconds) { 393 void OS::Sleep(int milliseconds) {
411 unsigned int ms = static_cast<unsigned int>(milliseconds); 394 unsigned int ms = static_cast<unsigned int>(milliseconds);
412 usleep(1000 * ms); 395 usleep(1000 * ms);
413 } 396 }
414 397
415 398
416 void OS::Abort() { 399 void OS::Abort() {
417 // Redirect to std abort to signal abnormal program termination. 400 // Redirect to std abort to signal abnormal program termination.
418 abort(); 401 abort();
419 } 402 }
(...skipping 724 matching lines...) Expand 10 before | Expand all | Expand 10 after
1144 1127
1145 void Sampler::Stop() { 1128 void Sampler::Stop() {
1146 ASSERT(IsActive()); 1129 ASSERT(IsActive());
1147 SignalSender::RemoveActiveSampler(this); 1130 SignalSender::RemoveActiveSampler(this);
1148 SetActive(false); 1131 SetActive(false);
1149 } 1132 }
1150 1133
1151 #endif // ENABLE_LOGGING_AND_PROFILING 1134 #endif // ENABLE_LOGGING_AND_PROFILING
1152 1135
1153 } } // namespace v8::internal 1136 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/platform-freebsd.cc ('k') | src/platform-macos.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698