Chromium Code Reviews| 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) |