]> granicus.if.org Git - procps-ng/commit
library: make dynamic buffer management more efficient
authorJim Warner <james.warner@comcast.net>
Fri, 29 Mar 2013 05:00:00 +0000 (00:00 -0500)
committerCraig Small <csmall@enc.com.au>
Sun, 7 Apr 2013 07:35:49 +0000 (17:35 +1000)
commit6d605f521c54a7011b7a255762621febda4f67e8
tree9b9b25f31fb71f3d1f02036f7b21008c751f15b2
parentc2707dc2d7dc92909e3f2041e699df93a8afe516
library: make dynamic buffer management more efficient

When dynamic buffers were recently introduced for read
of the status, stat and statm subdirectories one extra
call to read() was required for end-of-file detection.

This patch avoids most all such extra calls to read().

Additionally, the frequency of memory reallocations is
reduced by overallocating each increase more than 25%.

Reference)s):
commit a45dace4b82c9cdcda7020ca5665153b1e81275f

Signed-off-by: Jim Warner <james.warner@comcast.net>
Signed-off-by: Craig Small <csmall@enc.com.au>
proc/readproc.c