This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [rfc] coalesce stack slots
- From: Nathan Myers <ncm at cantrip dot org>
- To: gcc-patches at gcc dot gnu dot org
- Cc: rth at redhat dot com, rasky at develer dot com, dberlin dot dberlin dot org at itasoftware dot com, nathan at codesourcery dot com
- Date: Tue, 07 Sep 2004 13:22:09 -0400
- Subject: Re: [rfc] coalesce stack slots
Richard Henderson wrote:
> That and Nathan [Sidwell]'s VEC's appear to only be able to
> "add N to the current size" rather than "set total size to N".
> At which point I quit looking.
When we were designing the reserve() member of the C++ standard
library template std::vector<>, several people thought its argument
should be relative to the current capacity, but I insisted that
reserve's argument should become the absolute capacity of the
vector. (After a reserve() call, an append() is guaranteed not
to trigger a reallocation if all the elements fit in the reserved
size.)
I "won", but I still find it hard to articulate precisely why it
was right. If you can explain it, posterity might benefit.
Nathan Myers