Click here to Skip to main content
15,921,989 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Performance and footprint of virtual function Pin
George_George30-Jan-08 23:05
George_George30-Jan-08 23:05 
GeneralRe: Performance and footprint of virtual function Pin
Iain Clarke, Warrior Programmer30-Jan-08 23:17
Iain Clarke, Warrior Programmer30-Jan-08 23:17 
GeneralRe: Performance and footprint of virtual function Pin
George_George30-Jan-08 23:21
George_George30-Jan-08 23:21 
GeneralRe: Performance and footprint of virtual function Pin
CPallini30-Jan-08 22:44
mveCPallini30-Jan-08 22:44 
GeneralRe: Performance and footprint of virtual function Pin
George_George30-Jan-08 23:02
George_George30-Jan-08 23:02 
GeneralRe: Performance and footprint of virtual function Pin
CPallini30-Jan-08 23:07
mveCPallini30-Jan-08 23:07 
GeneralRe: Performance and footprint of virtual function Pin
Cedric Moonen30-Jan-08 22:44
Cedric Moonen30-Jan-08 22:44 
GeneralRe: Performance and footprint of virtual function Pin
George_George30-Jan-08 22:59
George_George30-Jan-08 22:59 
Thanks Cédric,


So in your below points, the address of normal function is resolved at compile time and the address of virtual function is resolved at runtime, right?

Cedric Moonen wrote:
When a function is not a virtual function, there is no need to "find" the address of the function: whenever the compiler encounter a call to a specific function of a class, it knows that for this specific class, the address of the function is X. Exactly the same way as for global functions. So, it does a direct call to that function.

For a virtual function, it needs to be more intelligent: it's not because I call a function on class Y that it is this one function that needs to be called by the compiler. It is possible that instead the 'compiler' needs to call a function from one of its derivate class (if the class is of that specific type). This is solved by using the virtual table, which is created when the class instance is constructed.



regards,
George
QuestionAlternative to using FindWindow() in OnCopyData() Pin
demxine30-Jan-08 21:52
demxine30-Jan-08 21:52 
GeneralRe: Alternative to using FindWindow() in OnCopyData() Pin
Iain Clarke, Warrior Programmer30-Jan-08 21:59
Iain Clarke, Warrior Programmer30-Jan-08 21:59 
GeneralRe: Alternative to using FindWindow() in OnCopyData() Pin
demxine30-Jan-08 22:14
demxine30-Jan-08 22:14 
GeneralRe: Alternative to using FindWindow() in OnCopyData() Pin
Iain Clarke, Warrior Programmer30-Jan-08 22:28
Iain Clarke, Warrior Programmer30-Jan-08 22:28 
GeneralRe: Alternative to using FindWindow() in OnCopyData() Pin
David Crow31-Jan-08 3:05
David Crow31-Jan-08 3:05 
GeneralRe: Alternative to using FindWindow() in OnCopyData() Pin
Haroon Sarwar30-Jan-08 22:37
Haroon Sarwar30-Jan-08 22:37 
GeneralRe: Alternative to using FindWindow() in OnCopyData() Pin
demxine30-Jan-08 23:40
demxine30-Jan-08 23:40 
GeneralRe: Alternative to using FindWindow() in OnCopyData() Pin
Haroon Sarwar30-Jan-08 23:53
Haroon Sarwar30-Jan-08 23:53 
GeneralRe: Alternative to using FindWindow() in OnCopyData() Pin
David Crow31-Jan-08 3:04
David Crow31-Jan-08 3:04 
GeneralRe: Alternative to using FindWindow() in OnCopyData() Pin
demxine31-Jan-08 14:20
demxine31-Jan-08 14:20 
GeneralRe: Alternative to using FindWindow() in OnCopyData() Pin
David Crow1-Feb-08 3:05
David Crow1-Feb-08 3:05 
QuestionSAPI within Windows SDK? Pin
_NielsB30-Jan-08 20:53
_NielsB30-Jan-08 20:53 
GeneralActiveX control richedit control hides when pressing Alt key Pin
ShilpiP30-Jan-08 20:47
ShilpiP30-Jan-08 20:47 
GeneralRepost + Crosspost = Absolutely No help Pin
Rajesh R Subramanian30-Jan-08 21:11
professionalRajesh R Subramanian30-Jan-08 21:11 
GeneralRe: Repost + Crosspost = Absolutely No help Pin
ShilpiP30-Jan-08 22:00
ShilpiP30-Jan-08 22:00 
GeneralRe: ActiveX control richedit control hides when pressing Alt key Pin
Nitheesh George31-Jan-08 0:38
Nitheesh George31-Jan-08 0:38 
GeneralRe: ActiveX control richedit control hides when pressing Alt key Pin
ShilpiP31-Jan-08 1:05
ShilpiP31-Jan-08 1:05 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.