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

Unified Diff: runtime/vm/freelist.h

Issue 106593002: Write protect executable pages in the VM. Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/debugger.cc ('k') | runtime/vm/freelist.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/freelist.h
diff --git a/runtime/vm/freelist.h b/runtime/vm/freelist.h
index 8ec1ac45e8d90c880ab6f18d94186d5509fa9c03..9bed00ee4dbe89d3288578c806f10f7d9d12c52b 100644
--- a/runtime/vm/freelist.h
+++ b/runtime/vm/freelist.h
@@ -19,9 +19,15 @@ namespace dart {
// the element at the address following the next_ field.
class FreeListElement {
public:
+ // Maximum header size is three words (tags, next, and size).
+ static const intptr_t kHeaderSize = 3 * kWordSize;
+
FreeListElement* next() const {
return next_;
}
+ uword next_address() const {
+ return reinterpret_cast<uword>(&next_);
+ }
void set_next(FreeListElement* next) {
next_ = next;
@@ -75,7 +81,7 @@ class FreeList {
FreeList();
~FreeList();
- uword TryAllocate(intptr_t size);
+ uword TryAllocate(intptr_t size, bool is_protected);
void Free(uword addr, intptr_t size);
void Reset();
@@ -92,7 +98,9 @@ class FreeList {
void EnqueueElement(FreeListElement* element, intptr_t index);
FreeListElement* DequeueElement(intptr_t index);
- void SplitElementAfterAndEnqueue(FreeListElement* element, intptr_t size);
+ void SplitElementAfterAndEnqueue(FreeListElement* element,
+ intptr_t size,
+ bool is_protected);
void PrintSmall() const;
void PrintLarge() const;
« no previous file with comments | « runtime/vm/debugger.cc ('k') | runtime/vm/freelist.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698