Skip to content

Make `CowData` honor non-trivial copyability and destructibility on resize

Created by: RandomShaper

Note: since whenever making bigger when using a non-trivially copyable type we cannot just realloc, at least we leverage the exponential growth to avoid much of those alloc-copy-free cyles.

The big question is: do we apply this to 3.2 too? If we suspect that some weird/random crashes happen because of how it currently works, it will benefit from it. But that comes at the cost of some performance. Therefore, the option to keep it only for 4.0 to make it rock-solid, while keeping the buggy behavior on 3.2 may make more sense.


This code is generously donated by IMVU.

Merge request reports