Re: [PATCH] libstdc++: Do not leak empty COW strings

2021-12-09 Thread Jonathan Wakely via Gcc-patches
On Thu, 2 Dec 2021 at 17:21, Jonathan Wakely via Libstdc++ wrote: > > Apart from "don't bother changing the COW string", does anybody see a > reason we shouldn't do this? This passes all tests for normal COW > strings and fully-dynamic COW strings. Pushed to trunk. > > When non-const references,

[PATCH] libstdc++: Do not leak empty COW strings

2021-12-02 Thread Jonathan Wakely via Gcc-patches
Apart from "don't bother changing the COW string", does anybody see a reason we shouldn't do this? This passes all tests for normal COW strings and fully-dynamic COW strings. When non-const references, pointers or iterators are obtained to the contents of a COW std::basic_string, the implementati