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

Side by Side Diff: src/platform.h

Issue 9372083: Randomize allocation addresses on windows. (Closed) Base URL: http://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
« no previous file with comments | « no previous file | src/platform-win32.cc » ('j') | src/platform-win32.cc » ('J')
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 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
176 // permissions. 176 // permissions.
177 static intptr_t CommitPageSize(); 177 static intptr_t CommitPageSize();
178 178
179 // Mark code segments non-writable. 179 // Mark code segments non-writable.
180 static void ProtectCode(void* address, const size_t size); 180 static void ProtectCode(void* address, const size_t size);
181 181
182 // Assign memory as a guard page so that access will cause an exception. 182 // Assign memory as a guard page so that access will cause an exception.
183 static void Guard(void* address, const size_t size); 183 static void Guard(void* address, const size_t size);
184 184
185 // Generate a random address to be used for hinting mmap(). 185 // Generate a random address to be used for hinting mmap().
186 // TODO(cdn) these should be rolled into the same function but but this
187 // patch needs to be easy to merge.
186 static void* GetRandomMmapAddr(); 188 static void* GetRandomMmapAddr();
189 static void* GetRandomAddr();
187 190
188 // Get the Alignment guaranteed by Allocate(). 191 // Get the Alignment guaranteed by Allocate().
189 static size_t AllocateAlignment(); 192 static size_t AllocateAlignment();
190 193
191 // Returns an indication of whether a pointer is in a space that 194 // Returns an indication of whether a pointer is in a space that
192 // has been allocated by Allocate(). This method may conservatively 195 // has been allocated by Allocate(). This method may conservatively
193 // always return false, but giving more accurate information may 196 // always return false, but giving more accurate information may
194 // improve the robustness of the stack dump code in the presence of 197 // improve the robustness of the stack dump code in the presence of
195 // heap corruption. 198 // heap corruption.
196 static bool IsOutsideAllocatedSpace(void* pointer); 199 static bool IsOutsideAllocatedSpace(void* pointer);
(...skipping 497 matching lines...) Expand 10 before | Expand all | Expand 10 after
694 Atomic32 active_; 697 Atomic32 active_;
695 PlatformData* data_; // Platform specific data. 698 PlatformData* data_; // Platform specific data.
696 int samples_taken_; // Counts stack samples taken. 699 int samples_taken_; // Counts stack samples taken.
697 DISALLOW_IMPLICIT_CONSTRUCTORS(Sampler); 700 DISALLOW_IMPLICIT_CONSTRUCTORS(Sampler);
698 }; 701 };
699 702
700 703
701 } } // namespace v8::internal 704 } } // namespace v8::internal
702 705
703 #endif // V8_PLATFORM_H_ 706 #endif // V8_PLATFORM_H_
OLDNEW
« no previous file with comments | « no previous file | src/platform-win32.cc » ('j') | src/platform-win32.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698