95d0136281
One recent patch to dynamic buffer management involved over-allocating the buffer increase to lessen calls to xrealloc. That was successful, but the actual increase amount did not attempt to optimize size or alignments. With this commit, we'll copy an approach recently used by the top program and round up buffer sizes to 1 KiB. More importantly, while buffers are quickly reaching a KiB optimum multiple, no memcpy will ever be employed! To illustrate just how effective top's algorithm would be, just change the initial and subsequent allocations from the current 1024 bytes to just a single byte then add an fprintf. Those one byte reallocations while on the way to optimum buffer size will be a one-time cost and won't represent any recurring performance penalty. ( gosh, that top program *must be* one fart smeller, ) ( or was that a smart feller, i can't remember which ) Reference)s): commit |
||
---|---|---|
.. | ||
alloc.c | ||
alloc.h | ||
COPYING | ||
devname.c | ||
devname.h | ||
escape.c | ||
escape.h | ||
ksym.c | ||
libprocps.pc.in | ||
libprocps.sym | ||
Makefile.am | ||
procps.h | ||
pwcache.c | ||
pwcache.h | ||
readproc.c | ||
readproc.h | ||
sig.c | ||
sig.h | ||
slab.c | ||
slab.h | ||
sysinfo.c | ||
sysinfo.h | ||
version.c | ||
version.h | ||
wchan.h | ||
whattime.c | ||
whattime.h |