This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [gcc-in-cxx] replacing qsort with std::sort


2009/8/11 Pedro Lamarão <pedro.lamarao@ccppbrasil.org>:

> I've recently started my contributions to the gcc-in-cxx project, and
> eventually decided on the qsort suggestion because it seems the
> easiest one.

Attached is a much more extensive patch replacing qsort with std::sort.

I did not follow the suggestion of using bind to reuse the old
comparison functions.
Their "less" variants require less address taking and dereferencing
and are much smaller.
These functions are used at only one or two places, each of them --
perfect for inlining.
This patch actually reduces the size of the final binary.

I have not yet made complete size and execution speed measurements, though.
I've run the test suite and there are some failures; I think many of
them are not regressions when compared with a pure build with C++.

--
 P.

Attachment: std_sort.patch
Description: Binary data


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]