mirror of
git://git.suckless.org/sbase
synced 2026-01-26 13:43:17 +00:00
sbase-box: Reduce bss size using dynamic memory
There are several big buffers that consume a lot of bss memory even when the applications are not used. This patch removes several of them using dynamic memory instead.
This commit is contained in:
parent
13db2e48d4
commit
7ff51bffd1
4
ls.c
4
ls.c
@ -33,7 +33,7 @@ struct entry {
|
||||
static struct {
|
||||
dev_t dev;
|
||||
ino_t ino;
|
||||
} tree[PATH_MAX];
|
||||
} *tree;
|
||||
|
||||
static int ret = 0;
|
||||
static int Aflag = 0;
|
||||
@ -371,6 +371,8 @@ main(int argc, char *argv[])
|
||||
struct entry ent, *dents, *fents;
|
||||
size_t i, ds, fs;
|
||||
|
||||
tree = ereallocarray(NULL, PATH_MAX, sizeof(*tree));
|
||||
|
||||
ARGBEGIN {
|
||||
case '1':
|
||||
/* force output to 1 entry per line */
|
||||
|
||||
3
xargs.c
3
xargs.c
@ -29,7 +29,7 @@ static size_t curprocs, maxprocs = 1;
|
||||
static int nerrors;
|
||||
static int nulflag, nflag, pflag, rflag, tflag, xflag, Iflag;
|
||||
static char *argb;
|
||||
static char *cmd[NARGS];
|
||||
static char **cmd;
|
||||
static char *eofstr;
|
||||
|
||||
static int
|
||||
@ -259,6 +259,7 @@ main(int argc, char *argv[])
|
||||
argmaxsz = _POSIX_ARG_MAX;
|
||||
/* Leave some room for environment variables */
|
||||
argmaxsz -= 4096;
|
||||
cmd = emalloc(NARGS * sizeof(*cmd));
|
||||
|
||||
ARGBEGIN {
|
||||
case '0':
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user