(1) how to hide helper classes (2) KDE_NO_INLINE missing?

Zack Rusin zack at kde.org
Sun Mar 7 06:38:09 GMT 2004


On Saturday 06 March 2004 14:50, Dr. Juergen Pfennig wrote:
> Object orientation sometimes causes lots of classes, many of them
> only being used internally in a module. Unfortunately by default such
> classes get exported by the linker into .so modules. What is the
> KDE-official way avoid this in order to keep .so modules as small as
> possible?
>
> Is there a cool way to hide helper classes that do not need to be
> exported?
>
> I could use KDE_NO_EXPORT to hide class members and to reduce the .so
> module size. But is this OK? I found that KDE_NO_EXPORT is rarely
> used.

Well, yes and no. It'd be ok if it worked :) The thing is that it 
doesn't. __attribute__ ((visibility("hidden"))) doesn't apply to types 
in gcc and we don't have alternatives for other compilers. I think Dirk 
reported this thing to gcc people a while back. IIRC someone wrote a 
patch about a month ago but I haven't checked whether it was applied. 
And even if it was we'll have to make sure that it was backported to 
3.3 and most probably change the version checks on the macro before 
using it.
So as of now it means that there's no way of marking whole classes as 
hidden.

> Could someone please add a KDE_NO_INLINE macro to kdemacros.h?
> Sometimes you know that inlining a function gives no real speed
> improvement but increases code size.

I don't see a problem with adding it but also don't cosider too high 
priority (besides having a method a method declared as noinline and 
then defined right in header file will be confusing :) ).

Zack

-- 
Elvis is dead, Mozart is dead, Einstein is dead, and I'm not feeling so
great myself.




More information about the kde-core-devel mailing list