[Patch]: Corrected patch for stl_tree.h to improve performance and memory usage
Gawain Bolton
gp.bolton@computer.org
Wed Mar 5 22:21:00 GMT 2003
Ok, here I go again. Please find attached a patch for stl_tree.h to
improve performance and memory usage. This patch differs from the
previous one (http://gcc.gnu.org/ml/libstdc++/2003-02/msg00398.html) in
that all compile errors have (hopefully) been fixed - the joys of
template classes! - as well as the implementation of the swap()
function which was seriously broken.
The swap() function is more complicated in order to deal with the
complications of having a non-pointer header data member. However, I
believe it satisfies the standard's requirements that it:
1. has constant complexity
2. will not throw an exception
3. does not invalidate any references, pointers, or iterators.
Some performance numbers were posted previously. This can be found here:
http://gcc.gnu.org/ml/libstdc++/2003-03/msg00000.html
Once again, all and any feedback appreciated.
Cheers,
Gawain
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: stl_tree.h.patch.txt
URL: <http://gcc.gnu.org/pipermail/libstdc++/attachments/20030305/0c37e79c/attachment.txt>
More information about the Libstdc++
mailing list