Final classes have virtual methods (c++)
Monkey Forums/Monkey Bug Reports/Final classes have virtual methods (c++)
| ||
If a class is declared as final in monkey, trans shouldn't need to declare it's methods virtual in the translated file. The thing is, a c++ compiler can't inline functions that are virtual (think of vector functions). I know it may sound picky but maybe it's an easy fix? PS: I have brought up the issue here before but I think it got deleted, would be nice if there could be an official word before that happens this time. |
| ||
Should be an easy fix, will take a look. |
| ||
See also line 352 in cstranslator. (Virtual calls on XBOX are even slower than normal (global hashtable instead of vtable array)).Local q$="public " If decl.IsStatic() q+="static " Else If decl.overrides And Not decl.IsCtor() q+="override " Else ' If Not decl.IsFinal <------- Should this be here??? q+="virtual " Endif Emit q+t+"{" EmitBlock decl Emit "}" |
| ||
The latest develop branch code at github contains an aggressive fix for this - it will only use 'virtual' when absolutely necessary, and declare methods final/sealed whether or not they are declared as such if they are not overridden. > Virtual calls on XBOX are even slower than normal (global hashtable instead of vtable array) I've heard this before somewhere but haven't seen any official/technical mention of it - do you have a link? |
| ||
Great, thanks! I am pretty sure this still applies. http://blogs.msdn.com/b/netcfteam/archive/2005/05/04/414820.aspx |