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

Side by Side Diff: src/platform.h

Issue 8115014: Add hinting to improve ASLR for macos (all allocations) and linux (newly added allocation types). (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 9 years, 2 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-linux.cc » ('j') | src/platform-linux.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 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
171 size_t* allocated, 171 size_t* allocated,
172 bool is_executable); 172 bool is_executable);
173 static void Free(void* address, const size_t size); 173 static void Free(void* address, const size_t size);
174 174
175 // Mark code segments non-writable. 175 // Mark code segments non-writable.
176 static void ProtectCode(void* address, const size_t size); 176 static void ProtectCode(void* address, const size_t size);
177 177
178 // Assign memory as a guard page so that access will cause an exception. 178 // Assign memory as a guard page so that access will cause an exception.
179 static void Guard(void* address, const size_t size); 179 static void Guard(void* address, const size_t size);
180 180
181 // Generate a random address to be used for hinting mmap().
182 static void* GetRandomMmapAddr();
183
181 // Get the Alignment guaranteed by Allocate(). 184 // Get the Alignment guaranteed by Allocate().
182 static size_t AllocateAlignment(); 185 static size_t AllocateAlignment();
183 186
184 // Returns an indication of whether a pointer is in a space that 187 // Returns an indication of whether a pointer is in a space that
185 // has been allocated by Allocate(). This method may conservatively 188 // has been allocated by Allocate(). This method may conservatively
186 // always return false, but giving more accurate information may 189 // always return false, but giving more accurate information may
187 // improve the robustness of the stack dump code in the presence of 190 // improve the robustness of the stack dump code in the presence of
188 // heap corruption. 191 // heap corruption.
189 static bool IsOutsideAllocatedSpace(void* pointer); 192 static bool IsOutsideAllocatedSpace(void* pointer);
190 193
(...skipping 490 matching lines...) Expand 10 before | Expand all | Expand 10 after
681 Atomic32 active_; 684 Atomic32 active_;
682 PlatformData* data_; // Platform specific data. 685 PlatformData* data_; // Platform specific data.
683 int samples_taken_; // Counts stack samples taken. 686 int samples_taken_; // Counts stack samples taken.
684 DISALLOW_IMPLICIT_CONSTRUCTORS(Sampler); 687 DISALLOW_IMPLICIT_CONSTRUCTORS(Sampler);
685 }; 688 };
686 689
687 690
688 } } // namespace v8::internal 691 } } // namespace v8::internal
689 692
690 #endif // V8_PLATFORM_H_ 693 #endif // V8_PLATFORM_H_
OLDNEW
« no previous file with comments | « no previous file | src/platform-linux.cc » ('j') | src/platform-linux.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698