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

Unified Diff: Source/platform/heap/Heap.h

Issue 941073002: Oilpan: improve handling of ASan contiguous container annotations. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Tidying adjustments 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
« no previous file with comments | « no previous file | Source/platform/heap/Heap.cpp » ('j') | Source/platform/heap/Heap.cpp » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/heap/Heap.h
diff --git a/Source/platform/heap/Heap.h b/Source/platform/heap/Heap.h
index 66dedb0b733fc1c1acc42e3ff989cb40111266d1..171a948c282210601b92c3d89b1ad31dff374528 100644
--- a/Source/platform/heap/Heap.h
+++ b/Source/platform/heap/Heap.h
@@ -38,6 +38,7 @@
#include "public/platform/WebThread.h"
#include "wtf/Assertions.h"
#include "wtf/Atomics.h"
+#include "wtf/ContainerAnnotations.h"
#include "wtf/HashCountedSet.h"
#include "wtf/LinkedHashSet.h"
#include "wtf/ListHashSet.h"
@@ -567,9 +568,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 +2149,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;
« no previous file with comments | « no previous file | Source/platform/heap/Heap.cpp » ('j') | Source/platform/heap/Heap.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698