[Bug libstdc++/20114] Non-monotonic behavior of string::reserve

pcarlini at suse dot de gcc-bugzilla@gcc.gnu.org
Mon Feb 21 19:17:00 GMT 2005

------- Additional Comments From pcarlini at suse dot de  2005-02-21 02:54 -------
Not a but, really, not even of QoI type. What's going on is that your fourth
reserve, reserve(8165), actually asks for a capacity which is *lower* than the
current one (i.e., 16355), that is, in standard terms, a "non-binding shrink
request". Until 3.3 we completely disregarded those, as the standard allows, but
lately many people requested to honor those requests: indeed, trimming excess
allocated memory can be useful (look for Ferguson in the archives). Actually,
4.0.0, after a recent tweak of mine, goes even further and shrinks more, down to
8165, for your testcase.

           What    |Removed                     |Added
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |INVALID


More information about the Gcc-bugs mailing list