bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] use unlocked io in getdelim


From: Simon Josefsson
Subject: Re: [PATCH] use unlocked io in getdelim
Date: Thu, 28 Aug 2008 14:52:36 +0200
User-agent: Gnus/5.110011 (No Gnus v0.11) Emacs/22.2 (gnu/linux)

Bruno Haible <address@hidden> writes:

>> 2) Portability: getndelim2 uses freadptr and freedseek which appears
>>    non-portable by design (or?) -- having a getline that can be compiled
>>    on any C89/POSIX system can be useful
>> ...
>> It could be moved to a 'getline-portable' module.
>
> I don't think you need a separate module for this. Just keep the old code
> around in an
>
>    if (false)
>      {
>        /* portable, unoptimized code */
>      }
>    else
>      {
>        /* optimized code, relying on freadptr */
>      }
>
> idiom.

Sure, that work.  I'd prefer to solve it by having m4 code check whether
the non-portable code works or not, and then AC_SUBST in the proper
replacement function, either getline-fast.c or getline-slow.c.  This
allows a gnulib module 'getline-slow' for when people prefer a small and
simple implementation over a faster but more complex.

However, it seems Paolo's was satisfied with the simpler initial patch
so maybe nobody wants to work on this.

/Simon




reply via email to

[Prev in Thread] Current Thread [Next in Thread]