Googles appar
Huvudmeny

Post a Comment On: cbloom rants

"12-16-08 - Libraries and Cinit"

3 Comments -

1 – 3 of 3
Blogger Tom Forsyth said...

You could use the CINIT stuff purely to make a linked list of descriptor objects - no real "work", just a list of stuff to do. Then have the app call a proper MyLibraryInit() function which traverses the list of work-to-do and does the actual work that needs doing - registration etc. As it goes, it cleans up all the CINIT stuff.

OK, it's not really that much of an improvement.

December 16, 2008 at 8:13 PM

Blogger Julien Koenen said...

The zero-cost argument if you don't use it is not correct for at least one compiler/linker pair for a portable platform (Which adds a lot of garbage to the linked executable that you can't easily remove). And it's actually quite common to remove unreferenced global objects. What you can do to prevent that is to reference them from a (generated) cpp file (that works for our unit-tests on all compilers we use)

December 16, 2008 at 10:49 PM

Blogger cbloom said...

I know exception handling in some compilers adds a lot of overhead even if you never throw, but how does RTTI bloat the exe? Sure there's a bit of information per type, but normally the number of different types (with vtables) in a project is very small. Yeah it's more than zero, but with MSVC anyway it's rarely bigger than few kb.

December 16, 2008 at 11:12 PM

You can use some HTML tags, such as <b>, <i>, <a>

This blog does not allow anonymous comments.

Comment moderation has been enabled. All comments must be approved by the blog author.

You will be asked to sign in after submitting your comment.