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

Unified Diff: runtime/vm/pages.h

Issue 10905251: Lazy peer API. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 3 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 side-by-side diff with in-line comments
Download patch
Index: runtime/vm/pages.h
diff --git a/runtime/vm/pages.h b/runtime/vm/pages.h
index 83a07ddc0ffc45f2d10652dddbb95a43ce948474..948e464fac62c9d10936f726f922a40a47f5cb14 100644
--- a/runtime/vm/pages.h
+++ b/runtime/vm/pages.h
@@ -5,6 +5,8 @@
#ifndef VM_PAGES_H_
#define VM_PAGES_H_
+#include <map>
+
#include "vm/freelist.h"
#include "vm/globals.h"
#include "vm/virtual_memory.h"
@@ -59,6 +61,8 @@ class HeapPage {
void WriteProtect(bool read_only);
+ void SetPeer(RawObject* raw_obj, void* peer);
+
private:
static HeapPage* Initialize(VirtualMemory* memory, bool is_executable);
static HeapPage* Allocate(intptr_t size, bool is_executable);
@@ -201,6 +205,12 @@ class PageSpace {
void WriteProtect(bool read_only);
+ void SetPeer(RawObject* raw_obj, void* peer);
+
+ void* GetPeer(RawObject* raw_obj);
+
+ int64_t PeerCount() const;
+
private:
static const intptr_t kAllocatablePageSize = kPageSize - sizeof(HeapPage);
@@ -227,6 +237,8 @@ class PageSpace {
HeapPage* pages_tail_;
HeapPage* large_pages_;
+ std::map<RawObject*, void*> peer_;
siva 2012/09/14 00:03:46 Call this peer_table_ or peer_map_;
cshapiro 2012/09/15 01:23:41 Done.
+
// Page being used for bump allocation.
// The value has different meanings:
// NULL: Still bump allocating from last allocated fresh page.

Powered by Google App Engine
This is Rietveld 408576698