[prev in list] [next in list] [prev in thread] [next in thread] 

List:       busybox
Subject:    Re: [PATCH 2/3] platform: provide getline and getdelim if not
From:       Denys Vlasenko <vda.linux () googlemail ! com>
Date:       2011-06-30 0:36:27
Message-ID: 201106300236.27621.vda.linux () googlemail ! com
[Download RAW message or body]

On Wednesday 29 June 2011 19:41, Rich Felker wrote:
> On Wed, Jun 29, 2011 at 10:54:34AM +0200, Denys Vlasenko wrote:
> > On Wednesday 29 June 2011 04:45, Rich Felker wrote:
> > > On Wed, Jun 29, 2011 at 04:43:58AM +0200, Denys Vlasenko wrote:
> > > > > Are you just waiting for an update on this patch to push it in?
> > > > > The current code in git fails to compile on non-GNU systems because of
> > > > > missing getline().
> > > > 
> > > > Applied the fix. Please try current git.
> > > 
> > > Wouldn't it be better to use getc_unlocked? Performance could be
> > > substantially better especially when getc_unlocked is a macro.
> > 
> > We already do. libbb.h:
> > 
> > /* Busybox does not use threads, we can speed up stdio.
> >  * But don't define foo to foo_unlocked if foo_unlocked
> >  * is a macro (it might be defined back to foo!).
> >  */
> 
> The only time getc_unlocked will be noticably faster than getc is if
> it's a macro that can poke directly at the FILE struct...

Ok, I tested this:

#define B A
#define A B
A

and at least gcc doesn't enter infinite loop, so let's risk
having similar gets -> get_unlocked -> getc loop...

-- 
vda
_______________________________________________
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic