This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/20114] Non-monotonic behavior of string::reserve
- From: "pcarlini at suse dot de" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 21 Feb 2005 02:54:02 -0000
- Subject: [Bug libstdc++/20114] Non-monotonic behavior of string::reserve
- References: <20050220214129.20114.kreckel@ginac.de>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- 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
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20114