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

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

Issue 20953002: Properly implement OS::GetRandomMmapAddr() for Win32. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 4 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 | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 874 matching lines...) Expand 10 before | Expand all | Expand 10 after
885 static size_t allocate_alignment = 0; 885 static size_t allocate_alignment = 0;
886 if (allocate_alignment == 0) { 886 if (allocate_alignment == 0) {
887 SYSTEM_INFO info; 887 SYSTEM_INFO info;
888 GetSystemInfo(&info); 888 GetSystemInfo(&info);
889 allocate_alignment = info.dwAllocationGranularity; 889 allocate_alignment = info.dwAllocationGranularity;
890 } 890 }
891 return allocate_alignment; 891 return allocate_alignment;
892 } 892 }
893 893
894 894
895 static void* GetRandomAddr() { 895 void* OS::GetRandomMmapAddr() {
896 Isolate* isolate = Isolate::UncheckedCurrent(); 896 Isolate* isolate = Isolate::UncheckedCurrent();
897 // Note that the current isolate isn't set up in a call path via 897 // Note that the current isolate isn't set up in a call path via
898 // CpuFeatures::Probe. We don't care about randomization in this case because 898 // CpuFeatures::Probe. We don't care about randomization in this case because
899 // the code page is immediately freed. 899 // the code page is immediately freed.
900 if (isolate != NULL) { 900 if (isolate != NULL) {
901 // The address range used to randomize RWX allocations in OS::Allocate 901 // The address range used to randomize RWX allocations in OS::Allocate
902 // Try not to map pages into the default range that windows loads DLLs 902 // Try not to map pages into the default range that windows loads DLLs
903 // Use a multiple of 64k to prevent committing unused memory. 903 // Use a multiple of 64k to prevent committing unused memory.
904 // Note: This does not guarantee RWX regions will be within the 904 // Note: This does not guarantee RWX regions will be within the
905 // range kAllocationRandomAddressMin to kAllocationRandomAddressMax 905 // range kAllocationRandomAddressMin to kAllocationRandomAddressMax
(...skipping 1084 matching lines...) Expand 10 before | Expand all | Expand 10 after
1990 limit_mutex = CreateMutex(); 1990 limit_mutex = CreateMutex();
1991 } 1991 }
1992 1992
1993 1993
1994 void OS::TearDown() { 1994 void OS::TearDown() {
1995 delete limit_mutex; 1995 delete limit_mutex;
1996 } 1996 }
1997 1997
1998 1998
1999 } } // namespace v8::internal 1999 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698