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-win32.cc

Issue 21040002: Really fix break in r15919 now. (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 907 matching lines...) Expand 10 before | Expand all | Expand 10 after
918 return NULL; 918 return NULL;
919 } 919 }
920 920
921 921
922 static void* RandomizedVirtualAlloc(size_t size, int action, int protection) { 922 static void* RandomizedVirtualAlloc(size_t size, int action, int protection) {
923 LPVOID base = NULL; 923 LPVOID base = NULL;
924 924
925 if (protection == PAGE_EXECUTE_READWRITE || protection == PAGE_NOACCESS) { 925 if (protection == PAGE_EXECUTE_READWRITE || protection == PAGE_NOACCESS) {
926 // For exectutable pages try and randomize the allocation address 926 // For exectutable pages try and randomize the allocation address
927 for (size_t attempts = 0; base == NULL && attempts < 3; ++attempts) { 927 for (size_t attempts = 0; base == NULL && attempts < 3; ++attempts) {
928 base = VirtualAlloc(OS::GetRandomAddr(), size, action, protection); 928 base = VirtualAlloc(OS::GetRandomMmapAddr(), size, action, protection);
929 } 929 }
930 } 930 }
931 931
932 // After three attempts give up and let the OS find an address to use. 932 // After three attempts give up and let the OS find an address to use.
933 if (base == NULL) base = VirtualAlloc(NULL, size, action, protection); 933 if (base == NULL) base = VirtualAlloc(NULL, size, action, protection);
934 934
935 return base; 935 return base;
936 } 936 }
937 937
938 938
(...skipping 1051 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