| 94 | } |
| 95 | |
| 96 | static void* replaceAllocation(void* newElts, std::size_t typeSize, std::size_t newCapacity, std::size_t vSize = 0) { |
| 97 | void* newEltsReplace = std::malloc(newCapacity * typeSize); |
| 98 | if (vSize != 0) { |
| 99 | std::memcpy(newEltsReplace, newElts, vSize * typeSize); |
| 100 | } |
| 101 | std::free(newElts); |
| 102 | return newEltsReplace; |
| 103 | } |
| 104 | |
| 105 | // Note: Moving this function into the header may cause performance regression. |
| 106 | template<class Size_T> |
no outgoing calls
no test coverage detected