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

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: rebased 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..48b216f71e877748c1583ca56e876d8adc3a4ade 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"
@@ -201,6 +203,16 @@ class PageSpace {
void WriteProtect(bool read_only);
+ typedef std::map<RawObject*, void*> PeerTable;
+
+ void SetPeer(RawObject* raw_obj, void* peer);
+
+ void* GetPeer(RawObject* raw_obj);
+
+ int64_t PeerCount() const;
+
+ PeerTable* GetPeerTable() { return &peer_table_; }
+
private:
static const intptr_t kAllocatablePageSize = kPageSize - sizeof(HeapPage);
@@ -227,6 +239,8 @@ class PageSpace {
HeapPage* pages_tail_;
HeapPage* large_pages_;
+ PeerTable peer_table_;
+
// Page being used for bump allocation.
// The value has different meanings:
// NULL: Still bump allocating from last allocated fresh page.
« runtime/vm/dart_api_impl.cc ('K') | « runtime/vm/heap.cc ('k') | runtime/vm/pages.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698