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]

Re: x*alloc optimizations


Michael Meissner <meissner@cygnus.com> writes:
| This is an unneeded micro-optimization.  I would rather burn the 2-3
| instructions for every xmalloc call than add a bunch of configure support and
| ifdefs to complicate the code.  Especially for Canadian crosses where you can't
| test the behavior of the runtime system.  Another problem is that when GCC
| configured it, malloc/calloc/realloc behaved in one fashion, but when the user
| put the binary compiler on his/her system, the system malloc in the shared
| library now behaves differently.

I admit it may not be worth it, but it can be done without
complicating the code.  Uses of *alloc functions don't change
at all, and the only ifdefs I added (when I did this for fileutils)
were in the replacement lib/*alloc.c functions.  The m4 tests assume
*alloc are broken when cross compiling.


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