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

Unified Diff: third_party/WebKit/Source/wtf/Vector.h

Issue 2531973002: Simple BlinkGC heap compaction. (Closed)
Patch Set: add pointer alignment handling to SparseHeapBitmap Created 4 years 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: third_party/WebKit/Source/wtf/Vector.h
diff --git a/third_party/WebKit/Source/wtf/Vector.h b/third_party/WebKit/Source/wtf/Vector.h
index 0050854e6daad097fb8ba5cf431a08f2e5a78e3b..a6089891052775ee4424c38cb50e147db68a187d 100644
--- a/third_party/WebKit/Source/wtf/Vector.h
+++ b/third_party/WebKit/Source/wtf/Vector.h
@@ -492,6 +492,8 @@ class VectorBuffer<T, 0, Allocator>
return buffer();
}
+ T** bufferSlot() { return &m_buffer; }
+
protected:
using Base::m_size;
@@ -771,6 +773,8 @@ class VectorBuffer : protected VectorBufferBase<T, true, Allocator> {
return buffer() && buffer() != inlineBuffer();
}
+ T** bufferSlot() { return &m_buffer; }
+
protected:
using Base::m_size;
@@ -1595,6 +1599,7 @@ void Vector<T, inlineCapacity, Allocator>::trace(VisitorDispatcher visitor) {
if (Allocator::isHeapObjectAlive(buffer()))
return;
Allocator::markNoTracing(visitor, buffer());
+ Allocator::registerBackingStoreReference(visitor, Base::bufferSlot());
}
const T* bufferBegin = buffer();
const T* bufferEnd = buffer() + size();

Powered by Google App Engine
This is Rietveld 408576698