hush/util-linux
Ron Yorston d840c5d139 libbb: add a function to make a copy of a region of memory
Introduce a library routine to package the idiom:

    p = xmalloc(b, n);
    memcpy(p, b, n);

and use it where possible.  The example in traceroute used xzalloc
but it didn't need to.

function                                             old     new   delta
xmemdup                                                -      32     +32
last_main                                            834     826      -8
make_device                                         2321    2311     -10
common_traceroute_main                              3698    3685     -13
readtoken1                                          3182    3168     -14
procps_scan                                         1222    1206     -16
forkchild                                            655     638     -17
------------------------------------------------------------------------------
(add/remove: 1/0 grow/shrink: 0/6 up/down: 32/-78)            Total: -46 bytes

Signed-off-by: Ron Yorston <rmy@frippery.org>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2015-07-19 23:05:20 +02:00
..
2015-03-11 16:07:24 +01:00
2013-01-05 21:02:14 -05:00
2013-02-11 00:22:59 +01:00
2013-01-14 01:34:48 +01:00
2015-02-04 15:19:38 +01:00
2015-03-12 20:18:51 +01:00
2013-01-14 01:34:48 +01:00
2013-06-27 03:45:16 +02:00
2013-01-14 01:34:48 +01:00
2015-05-25 13:46:36 +02:00
2015-02-18 13:47:46 +01:00
2011-12-15 12:39:25 +01:00
2015-01-05 20:35:00 +01:00
2015-04-16 12:44:02 +02:00