Will exe file size decrease while using inline function


 
Thread Tools Search this Thread
Top Forums Programming Will exe file size decrease while using inline function
# 1  
Old 08-31-2005
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*
# 2  
Old 08-31-2005
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.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. AIX

[ASK] decrease/shrink the size of filesystem

Hello, I would like to reduce the size of filesystem online. We can do online for increase without any problem. So any risk can be occurred with the decrease? This is not an issue, just a discussion for decrease/shrink space with chfs command. My AIX system is version 6.1 and the filesystem... (2 Replies)
Discussion started by: Phat
2 Replies

2. Programming

How to decrease virtual size of a process after cleaning all containers and using malloc_trim (0)?

Hello all i have simple server running on linux redhat 6.1 it is build with c++ in the server i have huge std vector that holds pointers to cache objects those cache objects holds allot of data from the DB any way ... in some point in time there is simple API that suppose to clean the... (2 Replies)
Discussion started by: umen
2 Replies

3. Programming

Perl : Inline program to determine file size

Hi, I have 5 files as below $ ll sam* -rw-rw-rw- 1 sam ugroup 0 Mar 21 06:06 sam3 -rw-rw-rw- 1 sam ugroup 0 Apr 3 22:41 sam2 -rw-rw-rw- 1 sam ugroup 17335 Apr 10 06:07 sam1 -rw-rw-rw- 1 sam ugroup 5 Apr 10 07:53 sam5 -rw-rw-rw- 1 sam ugroup 661 Apr 10 08:16 sam4 I want to list out... (4 Replies)
Discussion started by: sam05121988
4 Replies

4. UNIX for Dummies Questions & Answers

Decrease buffer size

Hi, I am using the below command to get the output in a file called "Logs.txt" tail -f filename | egrep -i "cpu | hung " >> Logs.txt The problem is the Logs.txt file gets updated only after the buffer is 8Kb, but i want to update the file immediately and not wait for the buffer to get 8kb. Is... (8 Replies)
Discussion started by: @bhi
8 Replies

5. AIX

Why using "%" of Paging size increases & how to decrease this percentage?

Hi I have found a problem on my AIX 5.1 server. day by day the paging size is increasing,what is the reason behind it and if percentage is at 100 what will happen. Oracle 9i is running on my server. PAGING SPACE size,mb 5632 % used 14.6 % free 85.3 How can i decrease the using... (6 Replies)
Discussion started by: dearsumon
6 Replies

6. Shell Programming and Scripting

decrease number by 1 in text file

i have text file which contains number like 234565 i need a shell script or command which decrease number by 1 in text file. pls (2 Replies)
Discussion started by: reyazan
2 Replies

7. Programming

Function pointer to inline function ?

Hi. Problem: I have to parse the payload of a packet. The payload could be in Big Endian Format (network byte order) or little. That depends on a flag present in the header of the packet. Solution: A horrible solution could be to check for that flag everytime I have to read a field in the... (11 Replies)
Discussion started by: emitrax
11 Replies

8. Shell Programming and Scripting

How to decrease the font size in Mailx

Hi all, I am using echo "$EMAILMESSAGE" | mailx -s "$SUBJECT" -b $CC "$TO" I am receiving the mail but seems to big in font size. Is there any option mailx to decrease the size of the mail generated. Thanks, (1 Reply)
Discussion started by: shellscripter
1 Replies

9. Programming

Inline function inside Classes

#include <iostream> using namespace std; class A { public: int Getvalue() { return i;} private: int i; }; int main() {} The above code compiles properly in g++ or in any other C++ compiler. BUT, the variable 'i' is used (in 'return i' statement) before it is... (1 Reply)
Discussion started by: deepthi.s
1 Replies

10. Programming

how To edit exe to insert a serial no wich can be usd by runing exe

At time of installation I have to open the resource. and i have to insert a string serial number in the exe. please provide me code to edit the exe (in solaris) to insert a serial number which can be used by exe at run time. (6 Replies)
Discussion started by: ssahu
6 Replies
Login or Register to Ask a Question