Skip to content

v1.0.1

Latest
Compare
Choose a tag to compare
@bodil bodil released this 24 Mar 18:38

FIXED

  • To avoid an issue where allocated heap memory may be deallocated with a different layout alignment than it was officially allocated with when converting between std::string::String and SmartString, even if otherwise correctly aligned, the respective From implementations now use std::alloc::Allocator::grow() to re-align the heap data as necessary. An unfortunate consequence of this is that because the std::alloc::Allocator API hasn't been stabilised yet, unless you're on nightly or some future stable rustc version after allocator_api has been stabilised, converting between String and SmartString will always reallocate and copy (making it always O(n) rather than O(1) when correctly aligned and O(n) otherwise). (#28)