Changeset 294750 in webkit
- Timestamp:
- May 24, 2022, 9:15:40 AM (4 years ago)
- File:
-
- 1 edited
-
trunk/Source/WTF/wtf/FastBitVector.cpp (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WTF/wtf/FastBitVector.cpp
r271921 r294750 35 35 void FastBitVectorWordOwner::setEqualsSlow(const FastBitVectorWordOwner& other) 36 36 { 37 uint32_t* newArray = static_cast<uint32_t*>( 38 FastBitVectorMalloc::zeroedMalloc(other.arrayLength() * sizeof(uint32_t))); 37 uint32_t* newArray = static_cast<uint32_t*>(FastBitVectorMalloc::malloc(other.arrayLength() * sizeof(uint32_t))); 39 38 memcpy(newArray, other.m_words, other.arrayLength() * sizeof(uint32_t)); 40 39 if (m_words) … … 47 46 { 48 47 size_t newLength = fastBitVectorArrayLength(numBits); 49 50 RELEASE_ASSERT(newLength >= arrayLength());48 size_t oldLength = arrayLength(); 49 RELEASE_ASSERT(newLength >= oldLength); 51 50 52 // Use fast Calloc instead of fastRealloc because we expect the common51 // Use fastMalloc instead of fastRealloc because we expect the common 53 52 // use case for this method to be initializing the size of the bitvector. 54 53 55 uint32_t* newArray = static_cast<uint32_t*>(FastBitVectorMalloc::zeroedMalloc(newLength * sizeof(uint32_t))); 56 memcpy(newArray, m_words, arrayLength() * sizeof(uint32_t)); 54 uint32_t* newArray = static_cast<uint32_t*>(FastBitVectorMalloc::malloc(newLength * sizeof(uint32_t))); 55 memcpy(newArray, m_words, oldLength * sizeof(uint32_t)); 56 memset(newArray + oldLength, 0, (newLength - oldLength) * sizeof(uint32_t)); 57 57 if (m_words) 58 58 FastBitVectorMalloc::free(m_words);
Note:
See TracChangeset
for help on using the changeset viewer.