This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: [RFC] libstdc++ atomicity, x86 agnostic version
Paolo Carlini <pcarlini@suse.de> writes:
| Benjamin Kosnik wrote:
|
| >Using Jakub's test:
| >
| >#include <string>
| >
| >using namespace std;
| >
| >bool b = true;
| >const string s = "abc";
| >
| >void foo(string &x)
| >{ }
| >
| >int main (void)
| >{
| > for (int i = 0; i < 10000000; ++i)
| > {
| > string t = s;
| > foo(t);
| > }
| >}
| >
| Well, it looks like part of the test is bogus (sorry Jakub!) since the
| argument x of foo is a reference and therefore no constructions and
| destructions take place...
Why not just ditch that ref from foo()?
-- Gaby
- References:
- [RFC] libstdc++ atomicity, x86 agnostic version
- Re: [RFC] libstdc++ atomicity, x86 agnostic version
- Re: [RFC] libstdc++ atomicity, x86 agnostic version
- Re: [RFC] libstdc++ atomicity, x86 agnostic version
- Re: [RFC] libstdc++ atomicity, x86 agnostic version
- Re: [RFC] libstdc++ atomicity, x86 agnostic version
- Re: [RFC] libstdc++ atomicity, x86 agnostic version
- Re: [RFC] libstdc++ atomicity, x86 agnostic version
- Re: [RFC] libstdc++ atomicity, x86 agnostic version
- Re: [RFC] libstdc++ atomicity, x86 agnostic version
- Re: [RFC] libstdc++ atomicity, x86 agnostic version