Rockbox.org home
releases
current build
extras FAQ
manual
wiki
docs index mailing lists
IRC
forums bugs
patches



Rockbox mail archive

Subject: Re: A nasty inefficieny in file.c?

Re: A nasty inefficieny in file.c?

From: Jonathan Gordon <jdgordy_at_gmail.com>
Date: 2006-07-15

grr, i cant get libsdl installed and that code definatly is no good,
so dont bother trying yet :p
to limit the distance it has to seek back would it be better to read
the smaller of MAX_PATH and buffer_size untill either the buffer is
full or we hit a new line? instead of just reading the full buffer
size?

On 15/07/06, Jonathan Gordon <jdgordy@gmail.com> wrote:
> On 15/07/06, Linus Nielsen Feltzing <linus@haxx.se> wrote:
> > Jonathan Gordon wrote:
> > > // move the fd back to AFTER the \n if needed
> > > if (!errno)
> > > lseek(fd,num_read-count+1,SEEK_CUR);
> >
> > That could be a really lengthy operation if it crosses a sector boundary.
> >
> but it that worse than doing lots of 1 byte reads?
> > Linus
> >
>
Received on Sat Jul 15 11:23:21 2006


Page was last modified "Mar 9 2008" The Rockbox Crew