Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
AccountSharedData::reserve: remove extra alloc + memcpy
Calling data_mut().reserve(additional) used to result in _two_ allocs and memcpys: the first to unshare the underlying vector, and the second upon calling reserve since Arc::make_mut clones so it uses capacity == len. With this fix we manually "unshare" allocating with capacity = len + additional, therefore saving on extra alloc and memcpy.
- Loading branch information