Ignore:
Timestamp:
Dec 20, 2016, 4:07:32 PM (7 years ago)
Author:
Bruno Cornec
Message:

New 3?3 banch for incorporation of latest busybox 1.25. Changing minor version to handle potential incompatibilities.

Location:
branches/3.3
Files:
1 edited
1 copied

Legend:

Unmodified
Added
Removed
  • branches/3.3/mindi-busybox/docs/keep_data_small.txt

    r2725 r3621  
    104104    SET_PTR_TO_GLOBALS(xzalloc(sizeof(G)));
    105105
    106 Typically it is done in <applet>_main().
     106Typically it is done in <applet>_main(). Another variation is
     107to use stack:
     108
     109int <applet>_main(...)
     110{
     111#undef G
     112    struct globals G;
     113    memset(&G, 0, sizeof(G));
     114    SET_PTR_TO_GLOBALS(&G);
    107115
    108116Now you can reference "globals" by G.a, G.buf and so on, in any function.
     
    137145#define dev_fd (G.dev_fd)
    138146#define sector (G.sector)
    139 
    140 
    141         Word of caution
    142 
    143 If applet doesn't use much of global data, converting it to use
    144 one of above methods is not worth the resulting code obfuscation.
    145 If you have less than ~300 bytes of global data - don't bother.
    146147
    147148
     
    224225
    225226        Keeping code small
     227
     228Use scripts/bloat-o-meter to check whether introduced changes
     229didn't generate unnecessary bloat. This script needs unstripped binaries
     230to generate a detailed report. To automate this, just use
     231"make bloatcheck". It requires busybox_old binary to be present,
     232use "make baseline" to generate it from unmodified source, or
     233copy busybox_unstripped to busybox_old before modifying sources
     234and rebuilding.
    226235
    227236Set CONFIG_EXTRA_CFLAGS="-fno-inline-functions-called-once",
Note: See TracChangeset for help on using the changeset viewer.