OLD | NEW |
---|---|
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 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
199 static void PrintError(const char* format, ...); | 199 static void PrintError(const char* format, ...); |
200 static void VPrintError(const char* format, va_list args); | 200 static void VPrintError(const char* format, va_list args); |
201 | 201 |
202 // Allocate/Free memory used by JS heap. Pages are readable/writable, but | 202 // Allocate/Free memory used by JS heap. Pages are readable/writable, but |
203 // they are not guaranteed to be executable unless 'executable' is true. | 203 // they are not guaranteed to be executable unless 'executable' is true. |
204 // Returns the address of allocated memory, or NULL if failed. | 204 // Returns the address of allocated memory, or NULL if failed. |
205 static void* Allocate(const size_t requested, | 205 static void* Allocate(const size_t requested, |
206 size_t* allocated, | 206 size_t* allocated, |
207 bool is_executable); | 207 bool is_executable); |
208 static void Free(void* address, const size_t size); | 208 static void Free(void* address, const size_t size); |
209 | |
210 // Assign memory as a guard page so that access will cause an exception. | |
211 static void Guard(void* address, const size_t size); | |
209 // Get the Alignment guaranteed by Allocate(). | 212 // Get the Alignment guaranteed by Allocate(). |
Vyacheslav Egorov (Chromium)
2011/07/15 11:59:14
empty line between declaration and comment.
Cris Neckar
2011/07/15 18:51:29
Done.
| |
210 static size_t AllocateAlignment(); | 213 static size_t AllocateAlignment(); |
211 | 214 |
212 // Returns an indication of whether a pointer is in a space that | 215 // Returns an indication of whether a pointer is in a space that |
213 // has been allocated by Allocate(). This method may conservatively | 216 // has been allocated by Allocate(). This method may conservatively |
214 // always return false, but giving more accurate information may | 217 // always return false, but giving more accurate information may |
215 // improve the robustness of the stack dump code in the presence of | 218 // improve the robustness of the stack dump code in the presence of |
216 // heap corruption. | 219 // heap corruption. |
217 static bool IsOutsideAllocatedSpace(void* pointer); | 220 static bool IsOutsideAllocatedSpace(void* pointer); |
218 | 221 |
219 // Sleep for a number of milliseconds. | 222 // Sleep for a number of milliseconds. |
(...skipping 434 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
654 Atomic32 active_; | 657 Atomic32 active_; |
655 PlatformData* data_; // Platform specific data. | 658 PlatformData* data_; // Platform specific data. |
656 int samples_taken_; // Counts stack samples taken. | 659 int samples_taken_; // Counts stack samples taken. |
657 DISALLOW_IMPLICIT_CONSTRUCTORS(Sampler); | 660 DISALLOW_IMPLICIT_CONSTRUCTORS(Sampler); |
658 }; | 661 }; |
659 | 662 |
660 | 663 |
661 } } // namespace v8::internal | 664 } } // namespace v8::internal |
662 | 665 |
663 #endif // V8_PLATFORM_H_ | 666 #endif // V8_PLATFORM_H_ |
OLD | NEW |