![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| High Level Programming Post questions about C, C++, Java, SQL, and other programming languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Problem to send rtf inline body | srik_ux | UNIX for Dummies Questions & Answers | 7 | 05-30-2008 12:30 PM |
| Array Printing Inline | vakharia Mahesh | Shell Programming and Scripting | 2 | 05-21-2008 01:53 PM |
| command to find out total size of a specific file size (spread over the server) | abhinov | SUN Solaris | 3 | 08-08-2007 07:48 AM |
| Inline Parameters-Urgent | indira | Shell Programming and Scripting | 2 | 05-02-2007 05:02 PM |
| sed / awk - inplace or inline edit | hemangjani | Shell Programming and Scripting | 6 | 02-22-2007 06:40 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Will exe file size decrease while using inline function
using namespace std;
void g(); class A { public : A() { g();g();g(); cout << "Constructor of A"<< endl ;} }; inline void g(){ cout << "vijay" <<endl; } int main() { A a; } when i use inline i get size 303488 Aug 31 12:05 a.out* when not using inline i get size 303572 Aug 31 12:05 a.out* |
|
||||
|
You cannot predict the size of an executable. Inlining often results in LARGER code blocks, not smaller. Note the word "often". Compilers do fun things when they optimize.
Compilers are not duty-bound to optimize just because you think they should. If you use complex, tricky code compilers will often decide not to optimize. HPUX C compilers do this - they back down optimization levels when presented with really convoluted code. The only way I could imagine the size decreasing is because you invoke the inline function call in just one place in your code, or that some other optimization was turned off/on because of the inline function. |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|