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

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

Issue 9452002: Ensure that executable pages are properly guarded. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 10 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 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 337 matching lines...) Expand 10 before | Expand all | Expand 10 after
348 return true; 348 return true;
349 } 349 }
350 350
351 351
352 bool VirtualMemory::Uncommit(void* address, size_t size) { 352 bool VirtualMemory::Uncommit(void* address, size_t size) {
353 ASSERT(IsReserved()); 353 ASSERT(IsReserved());
354 return VirtualFree(address, size, MEM_DECOMMIT) != false; 354 return VirtualFree(address, size, MEM_DECOMMIT) != false;
355 } 355 }
356 356
357 357
358 bool VirtualMemory::Guard(void* address) {
359 if (NULL == VirtualAlloc(address,
360 OS::CommitPageSize(),
361 MEM_COMMIT,
362 PAGE_READONLY | PAGE_GUARD)) {
Erik Corry 2012/02/23 12:00:40 Can we not map it with no permissions at all, inst
363 return false;
364 }
365 return true;
366 }
367
368
358 class Thread::PlatformData : public Malloced { 369 class Thread::PlatformData : public Malloced {
359 public: 370 public:
360 PlatformData() : thread_(kNoThread) {} 371 PlatformData() : thread_(kNoThread) {}
361 pthread_t thread_; // Thread handle for pthread. 372 pthread_t thread_; // Thread handle for pthread.
362 }; 373 };
363 374
364 375
365 376
366 377
367 Thread::Thread(const Options& options) 378 Thread::Thread(const Options& options)
(...skipping 382 matching lines...) Expand 10 before | Expand all | Expand 10 after
750 761
751 762
752 void Sampler::Stop() { 763 void Sampler::Stop() {
753 ASSERT(IsActive()); 764 ASSERT(IsActive());
754 SamplerThread::RemoveActiveSampler(this); 765 SamplerThread::RemoveActiveSampler(this);
755 SetActive(false); 766 SetActive(false);
756 } 767 }
757 768
758 769
759 } } // namespace v8::internal 770 } } // namespace v8::internal
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698