Sponsored Content
Top Forums Programming Will exe file size decrease while using inline function Post 82380 by jim mcnamara on Wednesday 31st of August 2005 10:45:33 AM
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.
 

10 More Discussions You Might Find Interesting

1. 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

2. 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

3. 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

4. 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

5. 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

6. 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

7. 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

8. 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

9. 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

10. 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
dwz(1)							      General Commands Manual							    dwz(1)

NAME
dwz - DWARF optimization and duplicate removal tool SYNOPSIS
dwz [OPTION...] [FILES] DESCRIPTION
dwz is a program that attempts to optimize DWARF debugging information contained in ELF shared libraries and ELF executables for size, by replacing DWARF information representation with equivalent smaller representation where possible and by reducing the amount of duplication using techniques from DWARF standard appendix E - creating DW_TAG_partial_unit compilation units (CUs) for duplicated information and using DW_TAG_imported_unit to import it into each CU that needs it. The tool handles DWARF 32-bit format debugging sections of versions 2, 3 and 4 and GNU extensions on top of those, though using DWARF 4 or worst case DWARF 3 is strongly recommended. The tool has two main modes of operation, without the -m option it attempts to optimize DWARF debugging information in each given object (executable or shared library) individually, with the -m option it afterwards attempts to optimize even more by moving DWARF debugging information entries (DIEs), strings and macro descriptions duplicated in more than one object into a newly created ELF ET_REL object whose filename is given as -m option argument. The debug sections in the executables and shared libraries specified on the command line are then modified again, referring to the entities in the newly created object. OPTIONS
-m FILE --multifile FILE Multifile mode. After processing all named executables and shared libraries, attempt to create ELF object FILE and put debugging information duplicated in more than one object there, afterwards optimize each named executable or shared library even further if possible. -h --hardlink Look for executables or shared libraries hardlinked together, instead of rewriting them individually rewrite just one of them and hardlink the rest to the first one again. -M NAME --multifile-name NAME Specify the name of the common file that should be put into the .gnu_debugaltlink section alongside with its build ID. By default dwz puts there the argument of the -m option. -r --relative Specify that the name of the common file to be put into the .gnu_debugaltlink section is supposed to be relative path from the directory containing the executable or shared library to the file named in the argument of the -m option. Either -M or -r option can be specified, but not both. -q --quiet Silence up some of the most common messages. -o FILE --output FILE This option instructs dwz not to overwrite the specified file, but instead store the new content into FILE. Nothing is written if dwz exits with non-zero exit code. Can be used only with a single executable or shared library (if there are no arguments at all, a.out is assumed). -l COUNT --low-mem-die-limit COUNT Handle executables or shared libraries containing more than COUNT debugging information entries in their .debug_info section using a slower and more memory usage friendly mode and don't attempt to optimize that object in multifile mode. The default is 10 million DIEs. There is a risk that for very large amounts of debugging information in a single shared library or executable there might not be enough memory (especially when dwz tool is 32-bit binary, it might run out of available virtual address space even sooner). -L COUNT --max-die-limit COUNT Don't attempt to optimize executables or shared libraries containing more than COUNT DIEs at all. The default is 50 million DIEs. -? --help Print short help and exit. ARGUMENTS
Command-line arguments should be the executables, shared libraries or their stripped to file separate debug information objects. EXAMPLES
$ dwz -m .dwz/foobar-1.2.debug -rh bin/foo.debug bin/foo2.debug foo/lib/libbar.so.debug will attempt to optimize debugging information in bin/foo.debug, bin/foo2.debug and lib/libbar.so.debug (by modifying the files in place) and when beneficial also will create .dwz/foobar-1.2.debug file. .gnu_debugaltlink section in the first two files will refer to ../.dwz/foobar-1.2.debug and in the last file to ../../.dwz/foobar-1.2.debug. If e.g. bin/foo.debug and bin/foo2.debug were hardlinked together initially, they will be hardlinked again and for multifile optimizations considered just as a single file rather than two. $ dwz -o foo.dwz foo will not modify foo but instead store the ELF object with optimized debugging information if successful into foo.dwz file it creates. $ dwz *.debug foo/*.debug will attempt to optimize debugging information in *.debug and foo/*.debug files, optimizing each file individually in place. $ dwz is equivalent to dwz a.out command. SEE ALSO
http://dwarfstd.org/doc/DWARF4.pdf , gdb(1). AUTHORS
Jakub Jelinek <jakub@redhat.com>. 15 June 2012 dwz(1)
All times are GMT -4. The time now is 05:07 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy