summaryrefslogtreecommitdiffstats
path: root/README
diff options
context:
space:
mode:
authorGravatar Hiltjo Posthuma 2023-03-08 21:20:52 +0100
committerGravatar Hiltjo Posthuma 2023-03-08 21:28:51 +0100
commitdfbbf7f6e1b22ccf9e5a45d77ee10995577fb4fc (patch)
treefc6aeadab9feb3ab590f81565e7005dd22bb52ef /README
parentreadstdin: allocate amount of items (diff)
readstdin: reduce memory-usage by duplicating the line from getline()
Improves upon commit 32db2b125190d366be472ccb7cad833248696144 The getline() implementation often uses a more greedy way of allocating memory. Using this buffer directly and forcing an allocation (by setting it to NULL) would waste a bit of extra space, depending on the implementation of course. Tested on musl libc and glibc. The current glibc version allocates a minimum of 120 bytes per line. For smaller lines musl libc seems less wasteful but still wastes a few bytes per line. On a dmenu_path listing on my system the memory usage was about 350kb (old) vs 30kb (new) on Void Linux glibc. Side-note that getline() also reads NUL bytes in lines, while strdup() would read until the NUL byte. Since dmenu reads text lines either is probably fine(tm). Also rename junk to linesiz.
Diffstat (limited to '')
0 files changed, 0 insertions, 0 deletions
h='13' height='13' alt='Gravatar' /> FRIGN 1-80/+64 2015-09-28Untypedef struct itemGravatar FRIGN 1-10/+9 2015-09-28Fix the conversion from microseconds to nanosecondsGravatar Quentin Rameau 1-1/+1 2015-09-28Replace deprecated usleep() with nanosleep()Gravatar Quentin Rameau 1-2/+3 2015-09-28config.mk: use -std=c99Gravatar Hiltjo Posthuma 1-1/+1 2015-09-27dmenu: style improvementsGravatar Hiltjo Posthuma 1-204/+213 2015-09-27drw style improvementsGravatar Hiltjo Posthuma 2-93/+106 2015-09-27separate program-specific c99 bool and X11Gravatar Hiltjo Posthuma 2-11/+10 2015-09-27config.mk: fix _XOPEN_SOURCE=700 for getline()Gravatar Hiltjo Posthuma 1-1/+1 2015-09-27config.mk: improve feature test checkGravatar Hiltjo Posthuma 1-1/+1 2015-08-06Fixed typo introduced by shared codeGravatar Eric Pruitt 1-1/+1 2015-07-19stest: get rid of getopt, use suckless arg.hGravatar Hiltjo Posthuma 3-53/+141 2015-07-19config.mk: add FREETYPELIBS and FREETYPEINCGravatar Hiltjo Posthuma 1-3/+9 2015-07-19fix prompt color style how it used to beGravatar Hiltjo Posthuma 1-1/+1 2015-06-27Use libdraw: add Xft and fallback-fonts support to graphics libGravatar Hiltjo Posthuma 11-316/+684 2014-09-17applied Hiltjo's patch as suggested on the ml to fix ControlMask for C-j and C-mGravatar Anselm R Garbe 2-2/+5 2014-07-30fix crash with ctrl-enter as inputGravatar Hiltjo Posthuma 1-1/+2 2014-05-29updated copyright notices in LICENSE and dmenu.c fileGravatar Anselm R Garbe 2-2/+2 2013-08-13applied Martin Kühl's inverse matching flag to stestGravatar Anselm R Garbe 2-4/+7 2013-08-02applied Martti Kühne's dmenu monitor patchGravatar Anselm R Garbe 3-4/+14 2013-06-28accepted vi'is exit approach ^[ (suggested by Arkaduisz)Gravatar Anselm R Garbe 1-0/+2