[Patch] Fix pthread7-rope.cc

Paolo Carlini pcarlini@suse.de
Sun Mar 28 09:59:00 GMT 2004


Hi,

today I noticed something really weird: pthread7-rope.cc was failing
also when configured to run /single/ threaded! Hummm...

Turns out the testcase is partially wrong ;)

We had this:

  const char* data2;

  {
    __gnu_cxx::crope foo2;
    foo2 += "bar2";
    foo2 += "baz2";
    foo2 += "bongle2";
    data2 = foo2.c_str();
    VERIFY( !std::strcmp (data2, "bar2baz2bongle2") );
  }

  ...
  ...
  ...
 
  VERIFY( std::strcmp (data2, "bar2baz2bongle2") );


Therefore, we were enforcing that the operations in the middle actually
trashed the (deallocated) memory pointed by data2.

Of course this is not the kind of thing you can reliably predict: a
different allocator leads, by chance, to the memory not being trashed.

Tomorrow morning will commit the below, which brings us to a clean
testsuite for mt_allocator on x86/x86_64/ia64.

Paolo.

//////////////
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: CL_pth
URL: <http://gcc.gnu.org/pipermail/libstdc++/attachments/20040328/aa414a68/attachment.ksh>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: patch_pth
URL: <http://gcc.gnu.org/pipermail/libstdc++/attachments/20040328/aa414a68/attachment-0001.ksh>


More information about the Libstdc++ mailing list