Initialize runtime constituents on runtime construction.
Change-Id: I63fff272b64bd29a7f828dac48aed91833af1eee
diff --git a/src/heap.h b/src/heap.h
index 7b31ebc..7c679eb 100644
--- a/src/heap.h
+++ b/src/heap.h
@@ -11,6 +11,14 @@
class Heap {
public:
+ static Heap* Create() {
+ Heap* new_heap = new Heap();
+ // TODO: should return NULL if the heap could not be created.
+ return new_heap;
+ }
+
+ ~Heap() {}
+
static Class* AllocClass(DexFile* dex_file) {
byte* raw = new byte[sizeof(Class)]();
Class* klass = reinterpret_cast<Class*>(raw);
@@ -38,6 +46,11 @@
string->count_ = count;
return string;
}
+
+ private:
+ Heap() {}
+
+ DISALLOW_COPY_AND_ASSIGN(Heap);
};
} // namespace art