Chromium Code Reviews| Index: Source/platform/heap/Heap.h |
| diff --git a/Source/platform/heap/Heap.h b/Source/platform/heap/Heap.h |
| index 66dedb0b733fc1c1acc42e3ff989cb40111266d1..635e951df7417c01d64629f4299acb9142acde05 100644 |
| --- a/Source/platform/heap/Heap.h |
| +++ b/Source/platform/heap/Heap.h |
| @@ -38,6 +38,9 @@ |
| #include "public/platform/WebThread.h" |
| #include "wtf/Assertions.h" |
| #include "wtf/Atomics.h" |
| +#if defined(ADDRESS_SANITIZER) |
|
inferno
2015/02/20 21:07:41
can you remove the if defined here. no need of thi
sof
2015/02/20 21:13:37
I could, but I don't want to incur another #includ
sof
2015/02/21 08:52:34
Done.
|
| +#include "wtf/ContainerAnnotations.h" |
| +#endif |
| #include "wtf/HashCountedSet.h" |
| #include "wtf/LinkedHashSet.h" |
| #include "wtf/ListHashSet.h" |
| @@ -567,9 +570,17 @@ public: |
| return reinterpret_cast<HeapObjectHeader*>(headerAddress); |
| } |
| +#ifdef ANNOTATE_CONTIGUOUS_CONTAINER |
| + void setIsVectorBackingPage() { m_isVectorBackingPage = true; } |
| + bool isVectorBackingPage() const { return m_isVectorBackingPage; } |
| +#endif |
| + |
| private: |
| size_t m_payloadSize; |
| +#ifdef ANNOTATE_CONTIGUOUS_CONTAINER |
| + bool m_isVectorBackingPage; |
| +#endif |
| }; |
| // A HeapDoesNotContainCache provides a fast way of taking an arbitrary |
| @@ -2140,6 +2151,12 @@ struct TraceInCollectionTrait<NoWeakHandlingInCollections, strongify, blink::Hea |
| // Use the payload size as recorded by the heap to determine how many |
| // elements to mark. |
| size_t length = header->payloadSize() / sizeof(T); |
| +#ifdef ANNOTATE_CONTIGUOUS_CONTAINER |
| + // Have no option but to mark the whole container as accessible, but |
| + // this trace() is only used for backing stores that are identified |
| + // as roots independent from a vector. |
| + ANNOTATE_CHANGE_SIZE(array, length, 0, length); |
| +#endif |
| for (size_t i = 0; i < length; ++i) |
| blink::CollectionBackingTraceTrait<ShouldBeTraced<Traits>::value, Traits::weakHandlingFlag, WeakPointersActStrong, T, Traits>::trace(visitor, array[i]); |
| return false; |