On 3/5/2018 5:11 PM, Deweloper wrote:
I see your point, forget about this bb_info_msg stuff.
The same result can still be achieved by using:
syslog_level = LOG_INFO
syslog_level = LOG_ERR
If I interpret bloatcheck results properly, the above costs extra
45 B of code per call @x86-64.
That sounded suspicious, so I checked. Might be worthwhile
investigating what gcc was up to, because assigning a small constant to
a global should be 7 bytes each on x86-64
However, pushing a small constant onto the stack should be 2 bytes,
though ironically loading that small constant into a register for
pass-by-register calling convention is 5.
So, with enough calls it would be worth it to create a new function,
with a savings of about 9 bytes per use over the global variable trick
vs. the cost of adding the new function.
(and wow, there's a nutty size optimization ... you could push a 1-byte
constant onto the stack and pop it off into the register of your choice
with two fewer bytes than the instruction to assign the constant
directly to the register.)
busybox mailing list