libbb: new function bb_die_memory_exhausted

function                                             old     new   delta
bb_die_memory_exhausted                                -      10     +10
xstrdup                                               28      23      -5
xsetenv                                               27      22      -5
xrealloc                                              32      27      -5
xputenv                                               22      17      -5
xmalloc                                               30      25      -5
xfdopen_helper                                        40      35      -5
xasprintf                                             44      39      -5
wget_main                                           2387    2382      -5
open_socket                                           54      49      -5
glob_brace                                           419     414      -5
bb_get_chunk_from_file                               146     141      -5
------------------------------------------------------------------------------
(add/remove: 1/0 grow/shrink: 0/11 up/down: 10/-55)           Total: -45 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
Denys Vlasenko
2018-04-01 19:59:37 +02:00
parent e2afae6303
commit 899ae5337a
7 changed files with 32 additions and 26 deletions

View File

@ -3158,7 +3158,7 @@ static int glob_brace(char *pattern, o_string *o, int n)
return o_save_ptr_helper(o, n);
}
if (gr == GLOB_NOSPACE)
bb_error_msg_and_die(bb_msg_memory_exhausted);
bb_die_memory_exhausted();
/* GLOB_ABORTED? Only happens with GLOB_ERR flag,
* but we didn't specify it. Paranoia again. */
bb_error_msg_and_die("glob error %d on '%s'", gr, pattern);
@ -3260,7 +3260,7 @@ static int perform_glob(o_string *o, int n)
goto literal;
}
if (gr == GLOB_NOSPACE)
bb_error_msg_and_die(bb_msg_memory_exhausted);
bb_die_memory_exhausted();
/* GLOB_ABORTED? Only happens with GLOB_ERR flag,
* but we didn't specify it. Paranoia again. */
bb_error_msg_and_die("glob error %d on '%s'", gr, pattern);