This is the mail archive of the newlib@sourceware.org mailing list for the newlib project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Speed up gets


On Nov 24 14:11, Jeff Johnston wrote:
> Corinna Vinschen wrote:
>> Hi,
>>
>> I'd like to propose the below patch.  The current code implements
>> gets/_gets_r in terms of _getchar_r calls.  That means, for every single
>> character of input the following sequence of functions is called:
>>
>>   for each char
>>     _getchar_r
>>       _getc_r
>>         _flockfile
>> 	_sgetc_r
>> 	_funlockfile
>>
>> It should be much quicker to move the locking up into gets itself and to
>> call __sgetc_r right there, as FreeBSD does as well:
>>
>>   _flockfile
>>   for each char
>>     _sgetc_r
>>   _funlockfile
>>
>> That doesn't change the fact that gets is inherently unsecure, of
>> course :)
>>
>> Ok to apply?
>>
>>   
> Yes, please go ahead.

Applied.


Thanks,
Corinna

-- 
Corinna Vinschen
Cygwin Project Co-Leader
Red Hat


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]