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

Unified Diff: Source/core/dom/Text.cpp

Issue 875503003: Allow Oilpan heap objects account for their external allocations. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Have conservative GC take prio over scheduled GC when urgent GCing Created 5 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: Source/core/dom/Text.cpp
diff --git a/Source/core/dom/Text.cpp b/Source/core/dom/Text.cpp
index 1436baa977b7a440d3554a1f7f4f834e3726ec11..fdefd7b29afc312a7fc5b1f93bdfa6c497e2d7cc 100644
--- a/Source/core/dom/Text.cpp
+++ b/Source/core/dom/Text.cpp
@@ -44,6 +44,11 @@ namespace blink {
PassRefPtrWillBeRawPtr<Text> Text::create(Document& document, const String& data)
{
+#if ENABLE(OILPAN)
+ size_t length = data.length();
+ if (length > 48)
+ Heap::increaseExternallyAllocatedBytes(length);
haraken 2015/02/10 01:23:17 Would it be possible to use these memory APIs in P
sof 2015/02/11 15:58:25 PartitionAlloc would have to know that it was an O
+#endif
return adoptRefWillBeNoop(new Text(document, data, CreateText));
}
@@ -408,6 +413,15 @@ PassRefPtrWillBeRawPtr<Text> Text::cloneWithData(const String& data)
return create(document(), data);
}
+void Text::trace(Visitor* visitor)
+{
+ size_t length = m_data.length();
+ if (length > 48)
+ Heap::increaseExternallyAllocatedBytesAlive(length);
haraken 2015/02/10 01:23:17 It looks dangerous to call increaseExternallyAlloc
sof 2015/02/11 15:58:25 As is, re-up'ing the allocation during tracing can
+
+ CharacterData::trace(visitor);
+}
+
#ifndef NDEBUG
void Text::formatForDebugger(char *buffer, unsigned length) const
{

Powered by Google App Engine
This is Rietveld 408576698