Click here to Skip to main content
16,013,747 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Class member inlining...??? Pin
Joaquín M López Muñoz4-Feb-02 21:31
Joaquín M López Muñoz4-Feb-02 21:31 
GeneralRe: Class member inlining...??? Pin
alex.barylski4-Feb-02 21:45
alex.barylski4-Feb-02 21:45 
AnswerRe: Class member inlining...??? Pin
Rickard Andersson204-Feb-02 23:07
Rickard Andersson204-Feb-02 23:07 
GeneralRe: Class member inlining...??? Pin
Christian Graus4-Feb-02 23:26
protectorChristian Graus4-Feb-02 23:26 
GeneralRe: Class member inlining...??? Pin
alex.barylski4-Feb-02 23:51
alex.barylski4-Feb-02 23:51 
AnswerRe: Class member inlining...??? Pin
5-Feb-02 5:44
suss5-Feb-02 5:44 
AnswerRe: Class member inlining...??? Pin
Andreas Saurwein5-Feb-02 6:07
Andreas Saurwein5-Feb-02 6:07 
GeneralRe: Class member inlining...??? Pin
alex.barylski5-Feb-02 10:58
alex.barylski5-Feb-02 10:58 
Andreas Saurwein wrote:
Besides of this you should ask yourself another question: if the compiler thinks that a function may be inlined, why you think it should not?

I always thought it was good practice to only inline those functions which were relatively small(a few push, mov and pop, ret)

My question was that i'm aware the compiler will implicity inline functions defined and declared in the class itself, but only under certain circumstances(NOT recursion, etc...)

Is there a way i can avoid this gauranteed!!!

3 member functions dec/defined in the class itself I feel are far to large to inline.

1) 500 bytes total( 51 prolog, 26 epilog) so i'd save 77 bytes if I inlined, but I'd have additional 423 bytes * already 9 function calls = 3807 bytes which could be avoided if the function didn't inline.

So under most circumstances I agree it's best to leave the compiler to do it's job, but this is an extenuating circumstance(I think).

I was unsure if the compiler would INLINE this function of mine, because it's a template class and all the functions have to dec/defined within the class(or they won't show in ClassView...?Cry | :(( )

I suppose i could have looked at the disassembly and determined if it was calling or inlining??? But i'm too lazy;P

Andreas Saurwein wrote:
Dont tell me that the function may be too big. The argument "the resulting code will be too big" is nonsense nowadays. Applications can expect "sufficient" memory to run almost any code.

Most certainly they can, with virtual memory and all(however i'm running a 266,Win98 32 MB RAM, which I find slow). However I feel this goes against what C/C++ stand for. According to(I think is the original "C Programming Language" By Kernighan&Rithchie) C is a relatively low-level language, so I'll assume C++ just follows suit, except better type checking, implementation hiding, etc...both support pointers and inline _asm

So if i didn't wanna worry about code execution and size I'd probably go back to VB...instead I find myself leaning more towards assembly Suspicious | :suss:

Have a day!



"An expert is someone who has made all the mistakes in his or her field" - Niels Bohr
AnswerRe: Class member inlining...??? Pin
Nemanja Trifunovic5-Feb-02 6:22
Nemanja Trifunovic5-Feb-02 6:22 
GeneralRe: Class member inlining...??? Pin
alex.barylski5-Feb-02 9:57
alex.barylski5-Feb-02 9:57 
GeneralHeap try/catch technique Pin
alex.barylski4-Feb-02 21:09
alex.barylski4-Feb-02 21:09 
GeneralRe: Heap try/catch technique Pin
Joaquín M López Muñoz4-Feb-02 21:36
Joaquín M López Muñoz4-Feb-02 21:36 
GeneralRe: Heap try/catch technique Pin
alex.barylski4-Feb-02 21:40
alex.barylski4-Feb-02 21:40 
GeneralRe: Heap try/catch technique Pin
Joaquín M López Muñoz4-Feb-02 22:01
Joaquín M López Muñoz4-Feb-02 22:01 
GeneralA problem with "find" operations in an application with CHtmlView Pin
AVR4-Feb-02 20:53
AVR4-Feb-02 20:53 
Generalwhen the owner window of caret is inactive Pin
AnonymousBabe@usa.net4-Feb-02 20:21
AnonymousBabe@usa.net4-Feb-02 20:21 
GeneralRe: when the owner window of caret is inactive Pin
alex.barylski4-Feb-02 20:45
alex.barylski4-Feb-02 20:45 
GeneralRe: when the owner window of caret is inactive Pin
AnonymousBabe@usa.net5-Feb-02 13:57
AnonymousBabe@usa.net5-Feb-02 13:57 
GeneralRe: when the owner window of caret is inactive Pin
alex.barylski5-Feb-02 14:26
alex.barylski5-Feb-02 14:26 
GeneralRe: when the owner window of caret is inactive Pin
AnonymousBabe@usa.net5-Feb-02 15:59
AnonymousBabe@usa.net5-Feb-02 15:59 
GeneralRe: when the owner window of caret is inactive Pin
alex.barylski5-Feb-02 16:39
alex.barylski5-Feb-02 16:39 
GeneralRe: when the owner window of caret is inactive Pin
AnonymousBabe@usa.net5-Feb-02 17:20
AnonymousBabe@usa.net5-Feb-02 17:20 
GeneralRe: when the owner window of caret is inactive Pin
alex.barylski5-Feb-02 17:49
alex.barylski5-Feb-02 17:49 
GeneralCD Writer Pin
4-Feb-02 20:07
suss4-Feb-02 20:07 
GeneralRe: CD Writer Pin
alex.barylski4-Feb-02 20:57
alex.barylski4-Feb-02 20:57 

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.