2
* Copyright (C) 2005, 2006, 2007, 2008 Apple Inc. All rights reserved.
4
* This library is free software; you can redistribute it and/or
5
* modify it under the terms of the GNU Library General Public
6
* License as published by the Free Software Foundation; either
7
* version 2 of the License, or (at your option) any later version.
9
* This library is distributed in the hope that it will be useful,
10
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12
* Library General Public License for more details.
14
* You should have received a copy of the GNU Library General Public License
15
* along with this library; see the file COPYING.LIB. If not, write to
16
* the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17
* Boston, MA 02110-1301, USA.
24
#include "FastAllocBase.h"
25
#include "Noncopyable.h"
27
#include "VectorTraits.h"
32
#include <QDataStream>
40
// WTF_ALIGN_OF / WTF_ALIGNED
41
#if COMPILER(GCC) || COMPILER(MINGW) || COMPILER(RVCT) || COMPILER(WINSCW)
42
#define WTF_ALIGN_OF(type) __alignof__(type)
43
#define WTF_ALIGNED(variable_type, variable, n) variable_type variable __attribute__((__aligned__(n)))
45
#define WTF_ALIGN_OF(type) __alignof(type)
46
#define WTF_ALIGNED(variable_type, variable, n) __declspec(align(n)) variable_type variable
48
#define WTF_ALIGN_OF(type) 0
51
#if COMPILER(GCC) && (((__GNUC__ * 100) + __GNUC_MINOR__) >= 303)
52
typedef char __attribute__((__may_alias__)) AlignedBufferChar;
54
typedef char AlignedBufferChar;
58
template <size_t size, size_t alignment> struct AlignedBuffer;
59
template <size_t size> struct AlignedBuffer<size, 1> { AlignedBufferChar buffer[size]; };
60
template <size_t size> struct AlignedBuffer<size, 2> { WTF_ALIGNED(AlignedBufferChar, buffer[size], 2); };
61
template <size_t size> struct AlignedBuffer<size, 4> { WTF_ALIGNED(AlignedBufferChar, buffer[size], 4); };
62
template <size_t size> struct AlignedBuffer<size, 8> { WTF_ALIGNED(AlignedBufferChar, buffer[size], 8); };
63
template <size_t size> struct AlignedBuffer<size, 16> { WTF_ALIGNED(AlignedBufferChar, buffer[size], 16); };
64
template <size_t size> struct AlignedBuffer<size, 32> { WTF_ALIGNED(AlignedBufferChar, buffer[size], 32); };
65
template <size_t size> struct AlignedBuffer<size, 64> { WTF_ALIGNED(AlignedBufferChar, buffer[size], 64); };
67
template <size_t size, size_t> struct AlignedBuffer
69
AlignedBufferChar oversizebuffer[size + 64];
70
AlignedBufferChar *buffer()
72
AlignedBufferChar *ptr = oversizebuffer;
73
ptr += 64 - (reinterpret_cast<size_t>(ptr) & 0x3f);
79
template <bool needsDestruction, typename T>
80
class VectorDestructor;
83
struct VectorDestructor<false, T>
85
static void destruct(T*, T*) {}
89
struct VectorDestructor<true, T>
91
static void destruct(T* begin, T* end)
93
for (T* cur = begin; cur != end; ++cur)
98
template <bool needsInitialization, bool canInitializeWithMemset, typename T>
99
class VectorInitializer;
101
template<bool ignore, typename T>
102
struct VectorInitializer<false, ignore, T>
104
static void initialize(T*, T*) {}
108
struct VectorInitializer<true, false, T>
110
static void initialize(T* begin, T* end)
112
for (T* cur = begin; cur != end; ++cur)
118
struct VectorInitializer<true, true, T>
120
static void initialize(T* begin, T* end)
122
memset(begin, 0, reinterpret_cast<char*>(end) - reinterpret_cast<char*>(begin));
126
template <bool canMoveWithMemcpy, typename T>
130
struct VectorMover<false, T>
132
static void move(T* src, const T* srcEnd, T* dst)
134
while (src != srcEnd) {
141
static void moveOverlapping(T* src, const T* srcEnd, T* dst)
144
move(src, srcEnd, dst);
146
T* dstEnd = dst + (srcEnd - src);
147
while (src != srcEnd) {
150
new (dstEnd) T(*srcEnd);
158
struct VectorMover<true, T>
160
static void move(T* src, const T* srcEnd, T* dst)
162
memcpy(dst, src, reinterpret_cast<const char*>(srcEnd) - reinterpret_cast<const char*>(src));
164
static void moveOverlapping(T* src, const T* srcEnd, T* dst)
166
memmove(dst, src, reinterpret_cast<const char*>(srcEnd) - reinterpret_cast<const char*>(src));
170
template <bool canCopyWithMemcpy, typename T>
174
struct VectorCopier<false, T>
176
static void uninitializedCopy(const T* src, const T* srcEnd, T* dst)
178
while (src != srcEnd) {
187
struct VectorCopier<true, T>
189
static void uninitializedCopy(const T* src, const T* srcEnd, T* dst)
191
memcpy(dst, src, reinterpret_cast<const char*>(srcEnd) - reinterpret_cast<const char*>(src));
195
template <bool canFillWithMemset, typename T>
199
struct VectorFiller<false, T>
201
static void uninitializedFill(T* dst, T* dstEnd, const T& val)
203
while (dst != dstEnd) {
211
struct VectorFiller<true, T>
213
static void uninitializedFill(T* dst, T* dstEnd, const T& val)
215
ASSERT(sizeof(T) == sizeof(char));
216
memset(dst, val, dstEnd - dst);
220
template<bool canCompareWithMemcmp, typename T>
221
class VectorComparer;
224
struct VectorComparer<false, T>
226
static bool compare(const T* a, const T* b, size_t size)
228
for (size_t i = 0; i < size; ++i)
236
struct VectorComparer<true, T>
238
static bool compare(const T* a, const T* b, size_t size)
240
return memcmp(a, b, sizeof(T) * size) == 0;
245
struct VectorTypeOperations
247
static void destruct(T* begin, T* end)
249
VectorDestructor<VectorTraits<T>::needsDestruction, T>::destruct(begin, end);
252
static void initialize(T* begin, T* end)
254
VectorInitializer<VectorTraits<T>::needsInitialization, VectorTraits<T>::canInitializeWithMemset, T>::initialize(begin, end);
257
static void move(T* src, const T* srcEnd, T* dst)
259
VectorMover<VectorTraits<T>::canMoveWithMemcpy, T>::move(src, srcEnd, dst);
262
static void moveOverlapping(T* src, const T* srcEnd, T* dst)
264
VectorMover<VectorTraits<T>::canMoveWithMemcpy, T>::moveOverlapping(src, srcEnd, dst);
267
static void uninitializedCopy(const T* src, const T* srcEnd, T* dst)
269
VectorCopier<VectorTraits<T>::canCopyWithMemcpy, T>::uninitializedCopy(src, srcEnd, dst);
272
static void uninitializedFill(T* dst, T* dstEnd, const T& val)
274
VectorFiller<VectorTraits<T>::canFillWithMemset, T>::uninitializedFill(dst, dstEnd, val);
277
static bool compare(const T* a, const T* b, size_t size)
279
return VectorComparer<VectorTraits<T>::canCompareWithMemcmp, T>::compare(a, b, size);
284
class VectorBufferBase : public Noncopyable {
286
void allocateBuffer(size_t newCapacity)
288
m_capacity = newCapacity;
289
if (newCapacity > std::numeric_limits<size_t>::max() / sizeof(T))
291
m_buffer = static_cast<T*>(fastMalloc(newCapacity * sizeof(T)));
294
void deallocateBuffer(T* bufferToDeallocate)
296
if (m_buffer == bufferToDeallocate) {
300
fastFree(bufferToDeallocate);
303
T* buffer() { return m_buffer; }
304
const T* buffer() const { return m_buffer; }
305
T** bufferSlot() { return &m_buffer; }
306
size_t capacity() const { return m_capacity; }
310
T* buffer = m_buffer;
323
VectorBufferBase(T* buffer, size_t capacity)
325
, m_capacity(capacity)
331
// FIXME: It would be nice to find a way to ASSERT that m_buffer hasn't leaked here.
338
template<typename T, size_t inlineCapacity>
342
class VectorBuffer<T, 0> : private VectorBufferBase<T> {
344
typedef VectorBufferBase<T> Base;
350
VectorBuffer(size_t capacity)
352
allocateBuffer(capacity);
357
deallocateBuffer(buffer());
360
void swap(VectorBuffer<T, 0>& other)
362
std::swap(m_buffer, other.m_buffer);
363
std::swap(m_capacity, other.m_capacity);
366
void restoreInlineBufferIfNeeded() { }
368
using Base::allocateBuffer;
369
using Base::deallocateBuffer;
372
using Base::bufferSlot;
373
using Base::capacity;
375
using Base::releaseBuffer;
377
using Base::m_buffer;
378
using Base::m_capacity;
381
template<typename T, size_t inlineCapacity>
382
class VectorBuffer : private VectorBufferBase<T> {
384
typedef VectorBufferBase<T> Base;
387
: Base(inlineBuffer(), inlineCapacity)
391
VectorBuffer(size_t capacity)
392
: Base(inlineBuffer(), inlineCapacity)
394
if (capacity > inlineCapacity)
395
Base::allocateBuffer(capacity);
400
deallocateBuffer(buffer());
403
void allocateBuffer(size_t newCapacity)
405
if (newCapacity > inlineCapacity)
406
Base::allocateBuffer(newCapacity);
408
m_buffer = inlineBuffer();
409
m_capacity = inlineCapacity;
413
void deallocateBuffer(T* bufferToDeallocate)
415
if (bufferToDeallocate == inlineBuffer())
417
Base::deallocateBuffer(bufferToDeallocate);
420
void restoreInlineBufferIfNeeded()
424
m_buffer = inlineBuffer();
425
m_capacity = inlineCapacity;
429
using Base::bufferSlot;
430
using Base::capacity;
434
if (buffer() == inlineBuffer())
436
return Base::releaseBuffer();
440
using Base::m_buffer;
441
using Base::m_capacity;
443
static const size_t m_inlineBufferSize = inlineCapacity * sizeof(T);
445
T* inlineBuffer() { return reinterpret_cast<T*>(m_inlineBuffer.buffer); }
447
T* inlineBuffer() { return reinterpret_cast<T*>(m_inlineBuffer.buffer()); }
450
AlignedBuffer<m_inlineBufferSize, WTF_ALIGN_OF(T)> m_inlineBuffer;
453
template<typename T, size_t inlineCapacity = 0>
454
class Vector : public FastAllocBase {
456
typedef VectorBuffer<T, inlineCapacity> Buffer;
457
typedef VectorTypeOperations<T> TypeOperations;
463
typedef const T* const_iterator;
470
explicit Vector(size_t size)
475
TypeOperations::initialize(begin(), end());
480
if (m_size) shrink(0);
483
Vector(const Vector&);
484
template<size_t otherCapacity>
485
Vector(const Vector<T, otherCapacity>&);
487
Vector& operator=(const Vector&);
488
template<size_t otherCapacity>
489
Vector& operator=(const Vector<T, otherCapacity>&);
491
size_t size() const { return m_size; }
492
size_t capacity() const { return m_buffer.capacity(); }
493
bool isEmpty() const { return !size(); }
498
return m_buffer.buffer()[i];
500
const T& at(size_t i) const
503
return m_buffer.buffer()[i];
506
T& operator[](size_t i) { return at(i); }
507
const T& operator[](size_t i) const { return at(i); }
509
T* data() { return m_buffer.buffer(); }
510
const T* data() const { return m_buffer.buffer(); }
511
T** dataSlot() { return m_buffer.bufferSlot(); }
513
iterator begin() { return data(); }
514
iterator end() { return begin() + m_size; }
515
const_iterator begin() const { return data(); }
516
const_iterator end() const { return begin() + m_size; }
518
T& first() { return at(0); }
519
const T& first() const { return at(0); }
520
T& last() { return at(size() - 1); }
521
const T& last() const { return at(size() - 1); }
523
template<typename U> size_t find(const U&) const;
525
void shrink(size_t size);
526
void grow(size_t size);
527
void resize(size_t size);
528
void reserveCapacity(size_t newCapacity);
529
void reserveInitialCapacity(size_t initialCapacity);
530
void shrinkCapacity(size_t newCapacity);
531
void shrinkToFit() { shrinkCapacity(size()); }
533
void clear() { shrinkCapacity(0); }
535
template<typename U> void append(const U*, size_t);
536
template<typename U> void append(const U&);
537
template<typename U> void uncheckedAppend(const U& val);
538
template<size_t otherCapacity> void append(const Vector<T, otherCapacity>&);
540
template<typename U> void insert(size_t position, const U*, size_t);
541
template<typename U> void insert(size_t position, const U&);
542
template<typename U, size_t c> void insert(size_t position, const Vector<U, c>&);
544
template<typename U> void prepend(const U*, size_t);
545
template<typename U> void prepend(const U&);
546
template<typename U, size_t c> void prepend(const Vector<U, c>&);
548
void remove(size_t position);
549
void remove(size_t position, size_t length);
557
Vector(size_t size, const T& val)
562
TypeOperations::uninitializedFill(begin(), end(), val);
565
void fill(const T&, size_t);
566
void fill(const T& val) { fill(val, size()); }
568
template<typename Iterator> void appendRange(Iterator start, Iterator end);
572
void swap(Vector<T, inlineCapacity>& other)
574
std::swap(m_size, other.m_size);
575
m_buffer.swap(other.m_buffer);
579
void expandCapacity(size_t newMinCapacity);
580
const T* expandCapacity(size_t newMinCapacity, const T*);
581
template<typename U> U* expandCapacity(size_t newMinCapacity, U*);
590
QDataStream& operator<<(QDataStream& stream, const Vector<T>& data)
592
stream << qint64(data.size());
593
foreach (const T& i, data)
599
QDataStream& operator>>(QDataStream& stream, Vector<T>& data)
605
data.reserveCapacity(count);
606
for (qint64 i = 0; i < count; ++i) {
614
template<typename T, size_t inlineCapacity>
615
Vector<T, inlineCapacity>::Vector(const Vector& other)
616
: m_size(other.size())
617
, m_buffer(other.capacity())
620
TypeOperations::uninitializedCopy(other.begin(), other.end(), begin());
623
template<typename T, size_t inlineCapacity>
624
template<size_t otherCapacity>
625
Vector<T, inlineCapacity>::Vector(const Vector<T, otherCapacity>& other)
626
: m_size(other.size())
627
, m_buffer(other.capacity())
630
TypeOperations::uninitializedCopy(other.begin(), other.end(), begin());
633
template<typename T, size_t inlineCapacity>
634
Vector<T, inlineCapacity>& Vector<T, inlineCapacity>::operator=(const Vector<T, inlineCapacity>& other)
639
if (size() > other.size())
640
shrink(other.size());
641
else if (other.size() > capacity()) {
643
reserveCapacity(other.size());
648
std::copy(other.begin(), other.begin() + size(), begin());
649
TypeOperations::uninitializedCopy(other.begin() + size(), other.end(), end());
650
m_size = other.size();
655
template<typename T, size_t inlineCapacity>
656
template<size_t otherCapacity>
657
Vector<T, inlineCapacity>& Vector<T, inlineCapacity>::operator=(const Vector<T, otherCapacity>& other)
662
if (size() > other.size())
663
shrink(other.size());
664
else if (other.size() > capacity()) {
666
reserveCapacity(other.size());
671
std::copy(other.begin(), other.begin() + size(), begin());
672
TypeOperations::uninitializedCopy(other.begin() + size(), other.end(), end());
673
m_size = other.size();
678
template<typename T, size_t inlineCapacity>
680
size_t Vector<T, inlineCapacity>::find(const U& value) const
682
for (size_t i = 0; i < size(); ++i) {
689
template<typename T, size_t inlineCapacity>
690
void Vector<T, inlineCapacity>::fill(const T& val, size_t newSize)
692
if (size() > newSize)
694
else if (newSize > capacity()) {
696
reserveCapacity(newSize);
701
std::fill(begin(), end(), val);
702
TypeOperations::uninitializedFill(end(), begin() + newSize, val);
706
template<typename T, size_t inlineCapacity>
707
template<typename Iterator>
708
void Vector<T, inlineCapacity>::appendRange(Iterator start, Iterator end)
710
for (Iterator it = start; it != end; ++it)
714
template<typename T, size_t inlineCapacity>
715
void Vector<T, inlineCapacity>::expandCapacity(size_t newMinCapacity)
717
reserveCapacity(max(newMinCapacity, max(static_cast<size_t>(16), capacity() + capacity() / 4 + 1)));
720
template<typename T, size_t inlineCapacity>
721
const T* Vector<T, inlineCapacity>::expandCapacity(size_t newMinCapacity, const T* ptr)
723
if (ptr < begin() || ptr >= end()) {
724
expandCapacity(newMinCapacity);
727
size_t index = ptr - begin();
728
expandCapacity(newMinCapacity);
729
return begin() + index;
732
template<typename T, size_t inlineCapacity> template<typename U>
733
inline U* Vector<T, inlineCapacity>::expandCapacity(size_t newMinCapacity, U* ptr)
735
expandCapacity(newMinCapacity);
739
template<typename T, size_t inlineCapacity>
740
inline void Vector<T, inlineCapacity>::resize(size_t size)
743
TypeOperations::destruct(begin() + size, end());
745
if (size > capacity())
746
expandCapacity(size);
748
TypeOperations::initialize(end(), begin() + size);
754
template<typename T, size_t inlineCapacity>
755
void Vector<T, inlineCapacity>::shrink(size_t size)
757
ASSERT(size <= m_size);
758
TypeOperations::destruct(begin() + size, end());
762
template<typename T, size_t inlineCapacity>
763
void Vector<T, inlineCapacity>::grow(size_t size)
765
ASSERT(size >= m_size);
766
if (size > capacity())
767
expandCapacity(size);
769
TypeOperations::initialize(end(), begin() + size);
773
template<typename T, size_t inlineCapacity>
774
void Vector<T, inlineCapacity>::reserveCapacity(size_t newCapacity)
776
if (newCapacity <= capacity())
778
T* oldBuffer = begin();
780
m_buffer.allocateBuffer(newCapacity);
782
TypeOperations::move(oldBuffer, oldEnd, begin());
783
m_buffer.deallocateBuffer(oldBuffer);
786
template<typename T, size_t inlineCapacity>
787
inline void Vector<T, inlineCapacity>::reserveInitialCapacity(size_t initialCapacity)
790
ASSERT(capacity() == inlineCapacity);
791
if (initialCapacity > inlineCapacity)
792
m_buffer.allocateBuffer(initialCapacity);
795
template<typename T, size_t inlineCapacity>
796
void Vector<T, inlineCapacity>::shrinkCapacity(size_t newCapacity)
798
if (newCapacity >= capacity())
801
if (newCapacity < size())
804
T* oldBuffer = begin();
805
if (newCapacity > 0) {
807
m_buffer.allocateBuffer(newCapacity);
808
if (begin() != oldBuffer)
809
TypeOperations::move(oldBuffer, oldEnd, begin());
812
m_buffer.deallocateBuffer(oldBuffer);
813
m_buffer.restoreInlineBufferIfNeeded();
816
// Templatizing these is better than just letting the conversion happen implicitly,
817
// because for instance it allows a PassRefPtr to be appended to a RefPtr vector
818
// without refcount thrash.
820
template<typename T, size_t inlineCapacity> template<typename U>
821
void Vector<T, inlineCapacity>::append(const U* data, size_t dataSize)
823
size_t newSize = m_size + dataSize;
824
if (newSize > capacity()) {
825
data = expandCapacity(newSize, data);
829
if (newSize < m_size)
832
for (size_t i = 0; i < dataSize; ++i)
833
new (&dest[i]) T(data[i]);
837
template<typename T, size_t inlineCapacity> template<typename U>
838
ALWAYS_INLINE void Vector<T, inlineCapacity>::append(const U& val)
841
if (size() == capacity()) {
842
ptr = expandCapacity(size() + 1, ptr);
848
// FIXME: MSVC7 generates compilation errors when trying to assign
849
// a pointer to a Vector of its base class (i.e. can't downcast). So far
850
// I've been unable to determine any logical reason for this, so I can
851
// only assume it is a bug with the compiler. Casting is a bad solution,
852
// however, because it subverts implicit conversions, so a better
854
new (end()) T(static_cast<T>(*ptr));
861
// This version of append saves a branch in the case where you know that the
862
// vector's capacity is large enough for the append to succeed.
864
template<typename T, size_t inlineCapacity> template<typename U>
865
inline void Vector<T, inlineCapacity>::uncheckedAppend(const U& val)
867
ASSERT(size() < capacity());
873
// This method should not be called append, a better name would be appendElements.
874
// It could also be eliminated entirely, and call sites could just use
875
// appendRange(val.begin(), val.end()).
876
template<typename T, size_t inlineCapacity> template<size_t otherCapacity>
877
inline void Vector<T, inlineCapacity>::append(const Vector<T, otherCapacity>& val)
879
append(val.begin(), val.size());
882
template<typename T, size_t inlineCapacity> template<typename U>
883
void Vector<T, inlineCapacity>::insert(size_t position, const U* data, size_t dataSize)
885
ASSERT(position <= size());
886
size_t newSize = m_size + dataSize;
887
if (newSize > capacity()) {
888
data = expandCapacity(newSize, data);
892
if (newSize < m_size)
894
T* spot = begin() + position;
895
TypeOperations::moveOverlapping(spot, end(), spot + dataSize);
896
for (size_t i = 0; i < dataSize; ++i)
897
new (&spot[i]) T(data[i]);
901
template<typename T, size_t inlineCapacity> template<typename U>
902
inline void Vector<T, inlineCapacity>::insert(size_t position, const U& val)
904
ASSERT(position <= size());
905
const U* data = &val;
906
if (size() == capacity()) {
907
data = expandCapacity(size() + 1, data);
911
T* spot = begin() + position;
912
TypeOperations::moveOverlapping(spot, end(), spot + 1);
917
template<typename T, size_t inlineCapacity> template<typename U, size_t c>
918
inline void Vector<T, inlineCapacity>::insert(size_t position, const Vector<U, c>& val)
920
insert(position, val.begin(), val.size());
923
template<typename T, size_t inlineCapacity> template<typename U>
924
void Vector<T, inlineCapacity>::prepend(const U* data, size_t dataSize)
926
insert(0, data, dataSize);
929
template<typename T, size_t inlineCapacity> template<typename U>
930
inline void Vector<T, inlineCapacity>::prepend(const U& val)
935
template<typename T, size_t inlineCapacity> template<typename U, size_t c>
936
inline void Vector<T, inlineCapacity>::prepend(const Vector<U, c>& val)
938
insert(0, val.begin(), val.size());
941
template<typename T, size_t inlineCapacity>
942
inline void Vector<T, inlineCapacity>::remove(size_t position)
944
ASSERT(position < size());
945
T* spot = begin() + position;
947
TypeOperations::moveOverlapping(spot + 1, end(), spot);
951
template<typename T, size_t inlineCapacity>
952
inline void Vector<T, inlineCapacity>::remove(size_t position, size_t length)
954
ASSERT(position < size());
955
ASSERT(position + length <= size());
956
T* beginSpot = begin() + position;
957
T* endSpot = beginSpot + length;
958
TypeOperations::destruct(beginSpot, endSpot);
959
TypeOperations::moveOverlapping(endSpot, end(), beginSpot);
963
template<typename T, size_t inlineCapacity>
964
inline T* Vector<T, inlineCapacity>::releaseBuffer()
966
T* buffer = m_buffer.releaseBuffer();
967
if (inlineCapacity && !buffer && m_size) {
968
// If the vector had some data, but no buffer to release,
969
// that means it was using the inline buffer. In that case,
970
// we create a brand new buffer so the caller always gets one.
971
size_t bytes = m_size * sizeof(T);
972
buffer = static_cast<T*>(fastMalloc(bytes));
973
memcpy(buffer, data(), bytes);
979
template<typename T, size_t inlineCapacity>
980
void deleteAllValues(const Vector<T, inlineCapacity>& collection)
982
typedef typename Vector<T, inlineCapacity>::const_iterator iterator;
983
iterator end = collection.end();
984
for (iterator it = collection.begin(); it != end; ++it)
988
template<typename T, size_t inlineCapacity>
989
inline void swap(Vector<T, inlineCapacity>& a, Vector<T, inlineCapacity>& b)
994
template<typename T, size_t inlineCapacity>
995
bool operator==(const Vector<T, inlineCapacity>& a, const Vector<T, inlineCapacity>& b)
997
if (a.size() != b.size())
1000
return VectorTypeOperations<T>::compare(a.data(), b.data(), a.size());
1003
template<typename T, size_t inlineCapacity>
1004
inline bool operator!=(const Vector<T, inlineCapacity>& a, const Vector<T, inlineCapacity>& b)
1014
#endif // WTF_Vector_h