index: improve buffer management and reduce mallocs.
authorGustavo Sverzut Barbieri <barbieri@profusion.mobi>
Thu, 8 Dec 2011 16:36:30 +0000 (14:36 -0200)
committerGustavo Sverzut Barbieri <barbieri@profusion.mobi>
Thu, 8 Dec 2011 16:38:22 +0000 (14:38 -0200)
commit405f614af978576586ef5aa2444cfa30ae132284
tree39fe3c702a0e3ad76a1fac3d418b0b667b214556
parente18ad35c640d67484d96c1ab71253ba1f69cc805
index: improve buffer management and reduce mallocs.

Grow buffer based on a step, avoiding hitting the system over and over
again.

Do not allocate the 'struct buffer' as in all cases the lifetime is
known and the pattern was allocate then free in every call site.
libkmod/libkmod-index.c