This is the mail archive of the libc-alpha@sources.redhat.com mailing list for the glibc 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: libintl.h not namespace clean in C++ mode


At Tue, 20 Jul 2004 22:59:11 +0200,
Bruno Haible wrote:
> GOTO Masanori wrote:
> > 	* intl/libintl.h: Don't use optimizing gettext definition in C++ mode.
> 
> It's not a particularly good idea to optimize things differently in C++ mode
> than in C mode: It causes surprises to the programmers.

I've confirmed that C++ optimization in your patch is valuable for
some cases.  Using my simple program which only calls gettext about
10000000 times on P4 2.4C with g++ 3.3.4 -O3 shows:

	No optimization:
		7.157u 0.003s 0:07.16 99.8%     0+0k 0+0io 0pf+0w

	Bruno's optimization using inline function which does not 
	break user defined "gettext" method:
		7.132u 0.000s 0:07.13 100.0%    0+0k 0+0io 0pf+0w

> Also why does your patch test the value of __cplusplus, while all other
> glibc header files test  'defined (__cplusplus)' ?

Right, my mistake.

Ulrich, could you look at Bruno's patch?

Regards,
-- gotom


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