Hi,
Attached patch fixes one case I found were the library uses excessive
memory.
It also avoids calling lseek() unless necessary just before a read()
or write(). This should fix an issue brought up by Bud Davis a long
time ago, where unformatted sequential performance was slow on NFS due
to the need to lseek() back and fix the record size, and then lseek()
forwards to the end of the record again. As long as the markers and
the record fits in the buffer, this is no longer an issue with this
patch. Unfortunately there is still one unnecessary lseek():in
occuring per record, so it's not optimal yet.
Also some minor cleanup/simplification.
Regtested on i686-pc-linux-gnu. Ok for trunk? It's a quite minor fix
after all, so I don't think it should go into 4.1.