This is the mail archive of the gcc-help@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: how to specify no vtable for a class ?


Hi Vincent,

>> http://www.maubi.net/~waterson/mozilla/journals/2000-11.html

> Do you think that this pragma [#pragma interface] can help ?

Since I don't know what the problem is you are encountering, I cannot say if following the contemplation by that website and enhancing GCC itself with the facilities to simulate __declspec(novtable) by embellishing what the "#pragma interface" does would help.

To me, that appears to be a lot of work to add an extension to GCC.  Is that kind of work worth it?  You'd have to tell me what the problem is for me to give my opinion on undertaking such an endeavor.

Off the top of my head and without information on the backstory of the problem you've run into, I think the MSVC++ __declspec(novtable) optimization is, itself, questionable.  I would not use it in my code without a compelling reason to use it.  That "compelling reason" would be one that is uncovered through profiling my code.

If my code was spending 10% of its time in unnecessary abstract base class vtable initializations, it might be worth it.

If my code was spending 1% of its time in unnecessary abstract base class vtable initializations, that doesn't seem worth it (considering how much work would be involved to "fix" the compiler to accommodate this non-compliant behavior).

Before I were to change the compiler, I'd consider alternative C++ friendly strategies such as using Generic Programming techniques to perform compile time polymorphism, which would make that optimization moot.

Sincerely,
--Eljay


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