make idlc generate ``NS_NO_VTABLE'' interfaces




18 years ago
18 years ago


(Reporter: waterson, Assigned: waterson)


Windows 2000

Firefox Tracking Flags

(Not tracked)



(1 attachment)



18 years ago
None of the idlc-generated interfaces require vtables, as they are all
pure-virtual classes. This saves a marginal amount of space on Win32 (about 25KB).

Comment 1

18 years ago
Created attachment 19863 [details] [diff] [review]
changes to XPCOMGen.cpp

Comment 2

18 years ago
Of course, all of the DOM IDL will need to be regenerated, too. Does this seem
I see no reason to not make this change other than the fact that the interfaces
will be converted over to XPILD soon so we'll get NS_NO_VTABLE from xpidl
automatically once that's done.

Comment 4

18 years ago
Does that count as ``r=jst''?

Comment 5

18 years ago

Looks good to me. Like jst said, we want to make this unnecessary soon.

Also, don't be too aggressive in spreading the NS_NO_VTABLE meme. It is a 
sharp tool. If it gets applied to a class that does actually call a virtual 
method in its ctor then *very* bad things happen.

Comment 6

18 years ago
jband: I presume that you meant, "if it accidentally gets applied to a class
that has anything but pure virtual methods, then very bad things will happen."
Or do I have a fundamental misunderstanding of what's going on here?

Comment 7

18 years ago
waterson: you got it right. I think this is fine here. I'm just 
generally concerned about people emulating this pattern without understanding 
where it is approriate and where it is not. It is actually technically OK to 
apply it on classes that have some implemented virtuals as long as that class's 
ctor does not actually call those methods (directly or otherwise). For me this 
was a concern in even creating NS_NO_VTABLE and putting it in our headers. Our 
project is plagued by copy/paste programming. I just don't want to see someone 
out there sprinking these all over the place because the *current* 
implementation of class X does not happen to call virtual method Y in its ctor. 
I'm just cautioning that we should be careful about how the meme is spread.

Comment 8

18 years ago
Changes checked in.
Last Resolved: 18 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.