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

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, 10 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 33235)
+++ runtime/vm/heap.cc (working copy)
@@ -91,7 +91,22 @@
return addr;
}
+void Heap::AllocateExternal(intptr_t size, RawObject* ref) {
+ if (ref->IsHeapObject() && ref->IsNewObject()) {
+ new_space_->AllocateExternal(size);
+ } else {
+ old_space_->AllocateExternal(size);
+ }
+}
+void Heap::FreeExternal(intptr_t size, RawObject* ref) {
+ if (ref->IsHeapObject() && ref->IsNewObject()) {
+ new_space_->FreeExternal(size);
+ } else {
+ old_space_->FreeExternal(size);
+ }
+}
+
bool Heap::Contains(uword addr) const {
return new_space_->Contains(addr) ||
old_space_->Contains(addr);
@@ -334,6 +349,10 @@
old_space_->CapacityInWords();
}
+intptr_t Heap::ExternalAllocatedInWords(Space space) const {
+ return space == kNew ? new_space_->ExternalAllocatedInWords() :
+ old_space_->ExternalAllocatedInWords();
+}
int64_t Heap::GCTimeInMicros(Space space) const {
if (space == kNew) {

Powered by Google App Engine
This is Rietveld 408576698