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

Unified Diff: Source/wtf/Vector.h

Issue 1098953006: Oilpan: Support polymorphic objects in HeapVectorBackings (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 8 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
« Source/platform/heap/Heap.h ('K') | « Source/platform/heap/HeapTest.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/wtf/Vector.h
diff --git a/Source/wtf/Vector.h b/Source/wtf/Vector.h
index 6a52675cb750dba0308bb88990634058930791e2..35f47926eb226c63afb6e9e1a33cd7d1b9030b1b 100644
--- a/Source/wtf/Vector.h
+++ b/Source/wtf/Vector.h
@@ -90,7 +90,9 @@ static const size_t kInitialVectorSize = WTF_VECTOR_INITIAL_SIZE;
struct VectorUnusedSlotClearer<true, T> {
static void clear(T* begin, T* end)
{
- memset(begin, 0, sizeof(T) * (end - begin));
+ char* array = reinterpret_cast<char*>(begin);
+ for (size_t i = 0; i < sizeof(T) * (end - begin); i++)
+ array[i] = 0;
haraken 2015/04/27 06:57:57 We cannot now use memset here because clang compla
sof 2015/04/30 21:15:47 It might rewrite that loop to a memset() applicati
haraken 2015/04/30 23:40:20 Thanks, it works.
}
#if ENABLE(ASSERT)
« Source/platform/heap/Heap.h ('K') | « Source/platform/heap/HeapTest.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698