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

Unified Diff: runtime/vm/heap.cc

Issue 187113003: Track external allocated memory for weak persistent handles. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 9 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/heap.cc
===================================================================
--- runtime/vm/heap.cc (revision 33396)
+++ runtime/vm/heap.cc (working copy)
@@ -90,7 +90,24 @@
return addr;
}
+void Heap::AllocateExternal(intptr_t size, Space space) {
+ if (space == kNew) {
+ new_space_->AllocateExternal(size);
+ } else {
+ ASSERT(space == kOld);
+ old_space_->AllocateExternal(size);
+ }
+}
+void Heap::FreeExternal(intptr_t size, Space space) {
+ if (space == kNew) {
+ new_space_->FreeExternal(size);
+ } else {
+ ASSERT(space == kOld);
+ old_space_->FreeExternal(size);
+ }
+}
+
bool Heap::Contains(uword addr) const {
return new_space_->Contains(addr) ||
old_space_->Contains(addr);
@@ -324,6 +341,10 @@
old_space_->CapacityInWords();
}
+intptr_t Heap::ExternalInWords(Space space) const {
+ return space == kNew ? new_space_->ExternalInWords() :
+ old_space_->ExternalInWords();
+}
int64_t Heap::GCTimeInMicros(Space space) const {
if (space == kNew) {
« runtime/vm/dart_api_state.h ('K') | « runtime/vm/heap.h ('k') | runtime/vm/pages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698