> Your first example points to a weakness in the compiler optimization.
> If base_string constructor is inlined, the compiler should be able to
> figure out both 'name' and the heap memory it points to can not be
> modified by the call to notify, and therefore hoist access name.c_str
> () and name.
On 29 December 2010 01:15, Hargett, Matt wrote:
>
> 1) allocation of std::string in local variable
> 2) calls to said local string's c_str() method within loops
> 3) and said loops do not modify the contents of the value returned from
> c_str()
You can't modify the contents, c_str() returns a con
Your first example points to a weakness in the compiler optimization.
If base_string constructor is inlined, the compiler should be able to
figure out both 'name' and the heap memory it points to can not be
modified by the call to notify, and therefore hoist access name.c_str
() and name.length ()
> I'm planning to add a set of new performance diagnostics to the
> libstdc++ profile mode
> (http://gcc.gnu.org/onlinedocs/libstdc++/manual/profile_mode.html) and
> am trying to come up with a list of what diagnostics are most
> meaningful and most wanted.
>
> At this (brainstorming) point I'm lo
Hello libstdc++ developers and users,
(I cc-ed gcc@gcc.gnu.org for a larger audience as others may offer
suggestions not as library developers but as C++ programmers. Sorry
in advance if this is spam to you.)
I'm planning to add a set of new performance diagnostics to the
libstdc++ profile mode