diff: stop using data/bss

function                                             old     new   delta
do_diff                                              385     436     +51
diff_main                                            850     895     +45
dump_unified_vec                                     437     457     +20
prepare                                              335     334      -1
anychange                                              1       -      -1
suff                                                   4       -      -4
status                                               135     131      -4
static.max_context                                     4       -      -4
start                                                 12       8      -4
pref                                                   4       -      -4
member                                                 4       -      -4
label2                                                 4       -      -4
label1                                                 4       -      -4
klist                                                  4       -      -4
ixold                                                  4       -      -4
ixnew                                                  4       -      -4
dl_count                                               4       -      -4
dl                                                     4       -      -4
context_vec_start                                      4       -      -4
context_vec_ptr                                        4       -      -4
context_vec_end                                        4       -      -4
context                                                4       -      -4
clistlen                                               4       -      -4
clist                                                  4       -      -4
clen                                                   4       -      -4
class                                                  4       -      -4
J                                                      4       -      -4
add_to_dirlist                                        71      64      -7
slen                                                   8       -      -8
sfile                                                  8       -      -8
len                                                    8       -      -8
file                                                   8       -      -8
get_dir                                              196     185     -11
newcand                                               97      85     -12
change                                               351     331     -20
stb2                                                  96       -     -96
stb1                                                  96       -     -96
diffreg                                             2835    2717    -118
------------------------------------------------------------------------------
(add/remove: 0/27 grow/shrink: 3/8 up/down: 116/-482)        Total: -366 bytes

# size */*/diff.o
   text    data     bss     dec     hex filename
   7055       8     305    7368    1cc8 busybox.t2/coreutils/diff.o
   7002       0       0    7002    1b5a busybox.t3/coreutils/diff.o
This commit is contained in:
Denis Vlasenko
2007-06-04 12:21:53 +00:00
parent 821cc25f43
commit ef4bb26f93
2 changed files with 79 additions and 50 deletions

View File

@@ -69,16 +69,16 @@ struct globals {
#define proc_meminfo (G.proc_meminfo )
#define proc_diskstats (G.proc_diskstats )
#define proc_sys_fs_filenr (G.proc_sys_fs_filenr)
// We depend on this being a char[], not char* - we take sizeof() of it
#define outbuf bb_common_bufsiz1
#define INIT_G() do { \
PTR_TO_GLOBALS = xzalloc(sizeof(G)); \
cur_outbuf = outbuf; \
final_str = "\n"; \
deltanz = delta = 1000000; \
} while (0)
// We depend on this being a char[], not char* - we take sizeof() of it
#define outbuf bb_common_bufsiz1
static inline void reset_outbuf(void)
{
cur_outbuf = outbuf;
@@ -774,7 +774,6 @@ int nmeter_main(int argc, char **argv)
s_stat *s;
char *cur, *prev;
PTR_TO_GLOBALS = xzalloc(sizeof(G));
INIT_G();
xchdir("/proc");