diff options
| author | Denys Vlasenko <vda.linux@googlemail.com> | 2026-02-05 13:36:27 +0100 |
|---|---|---|
| committer | Denys Vlasenko <vda.linux@googlemail.com> | 2026-02-05 13:36:27 +0100 |
| commit | fddd93edbdbf8c5afbfdb3c01d82e082a8a82d1a (patch) | |
| tree | bc67c4cd3acea69333eb7bb4d8d4d904d5d6027a /include/libbb.h | |
| parent | 3d572a8cc3d71b43877db2776882e91303a0532d (diff) | |
| download | busybox-w32-fddd93edbdbf8c5afbfdb3c01d82e082a8a82d1a.tar.gz busybox-w32-fddd93edbdbf8c5afbfdb3c01d82e082a8a82d1a.tar.bz2 busybox-w32-fddd93edbdbf8c5afbfdb3c01d82e082a8a82d1a.zip | |
libbb: introduce and use xasprintf_inplace()
function old new delta
xasprintf_and_free - 49 +49
watch_main 269 282 +13
singlemount 1313 1315 +2
append_mount_options 157 149 -8
ip_port_str 122 112 -10
lsblk_main 869 858 -11
add_cmd 1178 1167 -11
------------------------------------------------------------------------------
(add/remove: 1/0 grow/shrink: 2/4 up/down: 64/-40) Total: 24 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'include/libbb.h')
| -rw-r--r-- | include/libbb.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/include/libbb.h b/include/libbb.h index 7cca925b9..6ce01ea94 100644 --- a/include/libbb.h +++ b/include/libbb.h | |||
| @@ -950,6 +950,8 @@ int bb_putchar(int ch) FAST_FUNC; | |||
| 950 | int bb_putchar_stderr(char ch) FAST_FUNC; | 950 | int bb_putchar_stderr(char ch) FAST_FUNC; |
| 951 | int fputs_stdout(const char *s) FAST_FUNC; | 951 | int fputs_stdout(const char *s) FAST_FUNC; |
| 952 | char *xasprintf(const char *format, ...) __attribute__ ((format(printf, 1, 2))) FAST_FUNC RETURNS_MALLOC; | 952 | char *xasprintf(const char *format, ...) __attribute__ ((format(printf, 1, 2))) FAST_FUNC RETURNS_MALLOC; |
| 953 | char *xasprintf_and_free(char *allocated, const char *format, ...) __attribute__ ((format(printf, 2, 3))) FAST_FUNC RETURNS_MALLOC; | ||
| 954 | #define xasprintf_inplace(allocated, ...) ((allocated) = xasprintf_and_free((allocated), __VA_ARGS__)) | ||
| 953 | char *auto_string(char *str) FAST_FUNC; | 955 | char *auto_string(char *str) FAST_FUNC; |
| 954 | // gcc-4.1.1 still isn't good enough at optimizing it | 956 | // gcc-4.1.1 still isn't good enough at optimizing it |
| 955 | // (+200 bytes compared to macro) | 957 | // (+200 bytes compared to macro) |
