Click here to Skip to main content
15,912,837 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: inline declaration? Pin
Michael Dunn15-Apr-06 14:30
sitebuilderMichael Dunn15-Apr-06 14:30 
AnswerRe: inline declaration? Pin
Ryan Binns15-Apr-06 22:13
Ryan Binns15-Apr-06 22:13 
GeneralRe: inline declaration? Pin
9ine16-Apr-06 0:10
9ine16-Apr-06 0:10 
GeneralRe: inline declaration? Pin
Ryan Binns16-Apr-06 4:25
Ryan Binns16-Apr-06 4:25 
GeneralRe: inline declaration? Pin
9ine16-Apr-06 7:34
9ine16-Apr-06 7:34 
GeneralRe: inline declaration? Pin
Maxwell Chen16-Apr-06 7:44
Maxwell Chen16-Apr-06 7:44 
GeneralRe: inline declaration? Pin
9ine17-Apr-06 6:23
9ine17-Apr-06 6:23 
GeneralRe: inline declaration? Pin
Maxwell Chen17-Apr-06 7:02
Maxwell Chen17-Apr-06 7:02 
9ine wrote:
code size does not depend I presume on the inline or not. Executable size comes in quanta as in quantum physics, and it does not compile it larger until some amount of code is added, that is some reservation of space and if the code exceeds it then there comes increase in exe file and another reservation. it is just happenstance to get it grow larger introducing inline funcs.


This is the general case when we are developing our code.

In the beginnig, the output exe is 16KB.
We add some code, and it keeps in 16KB for a while.
And suddenly it becomes 20KB ... and then 24KB ...

- - -

But what I pointed out was:
- You implement some inline global or member functions, and have them heavily invoked everywhere in the code. In other words, you just mean to concentrate in playing inline topic.

And don't just implement such kind of code as:
int MyClass::GetNumber() {<br />
  return _iNum;<br />
}

but do something more overhead as:
int MyClass::GetNumber() {<br />
  BYTE data[5] = {0};<br />
  data[1] = 1;<br />
  data[2] = data[1] * 3 + 4;<br />
  data[3] = data[4] & ~data[2];<br />
  data[5] = (BYTE)_time(NULL);<br />
  // ...<br />
}


1) Turn OFF the inline switch in the compiler option, comment out the inline keyword, and compile it.
2) Turn ON the inline switch in the compiler option, put the inline keyword back, and compile it.

The term code bloat is seen in each articles and books talking about inline functions.
For example: [9.3] Do inline funcitons improve performance?[^]



Maxwell Chen
Questioncollisions between 2 rectangles Pin
bouli15-Apr-06 6:18
bouli15-Apr-06 6:18 
AnswerRe: collisions between 2 rectangles Pin
Ravi Bhavnani15-Apr-06 7:59
professionalRavi Bhavnani15-Apr-06 7:59 
GeneralRe: collisions between 2 rectangles Pin
bouli15-Apr-06 8:56
bouli15-Apr-06 8:56 
GeneralRe: collisions between 2 rectangles Pin
Ravi Bhavnani15-Apr-06 9:02
professionalRavi Bhavnani15-Apr-06 9:02 
QuestionMost basic and beginner's question Pin
CPP91115-Apr-06 5:45
CPP91115-Apr-06 5:45 
AnswerRe: Most basic and beginner's question Pin
Maxwell Chen15-Apr-06 6:06
Maxwell Chen15-Apr-06 6:06 
AnswerRe: Most basic and beginner's question Pin
Waldermort15-Apr-06 19:39
Waldermort15-Apr-06 19:39 
QuestionGetting ReadProcessMemory to work right Pin
slippnslide15-Apr-06 5:37
slippnslide15-Apr-06 5:37 
AnswerRe: Getting ReadProcessMemory to work right Pin
Ryan Binns15-Apr-06 22:17
Ryan Binns15-Apr-06 22:17 
QuestionMessage Box Pin
Laughing Buddha15-Apr-06 5:06
Laughing Buddha15-Apr-06 5:06 
AnswerRe: Message Box Pin
Ravi Bhavnani15-Apr-06 5:10
professionalRavi Bhavnani15-Apr-06 5:10 
AnswerRe: Message Box Pin
FarPointer15-Apr-06 5:23
FarPointer15-Apr-06 5:23 
AnswerRe: Message Box Pin
bob1697215-Apr-06 12:05
bob1697215-Apr-06 12:05 
GeneralRe: Message Box Pin
Ryan Binns15-Apr-06 22:18
Ryan Binns15-Apr-06 22:18 
GeneralRe: Message Box Pin
bob169722-May-06 18:20
bob169722-May-06 18:20 
GeneralRe: Message Box Pin
Ryan Binns2-May-06 23:29
Ryan Binns2-May-06 23:29 
QuestionCannot find a way to emulate Ctrl-Alt-Del on Windows NT Pin
Hovo15-Apr-06 4:20
Hovo15-Apr-06 4:20 

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.