RefCountedArray needs a size based constructor
Created attachment 195011 [details] Patch
Comment on attachment 195011 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=195011&action=review > Source/WTF/wtf/RefCountedArray.h:71 > + m_data = (static_cast<Header*>(fastMalloc(Header::size() + sizeof(T) * size)))->payload(); > + Header::fromPayload(m_data)->refCount = 1; > + Header::fromPayload(m_data)->length = size; > + ASSERT(Header::fromPayload(m_data)->length == size); You also need to call VectorTypeOperations::initialize() on the new data. Alternatively, by symmetry with Vector, you could have a reserveInitialCapacity() on RefCountedArray that does not do any initialization.
Created attachment 195029 [details] Patch
Comment on attachment 195029 [details] Patch LGTM.
Committed r146964: <http://trac.webkit.org/changeset/146964>