cvs commit: src/lib/libc/locale utf8.c

Daniel Eischen deischen at freebsd.org
Sat Oct 27 06:09:44 PDT 2007


On Sat, 27 Oct 2007, Rong-en Fan wrote:

> On 10/27/07, Rong-en Fan <grafan at gmail.com> wrote:
> [...]
>> I admit that I really did a very bad abi damage on libc. I have been
>> working on it and
>> removing those inline __* functions in _ctype.h help. It can be upgraded and
>> also downgraded without problems. Without those inline stuffs,
>> buildworld+installworld
>> time difference is less than 60 seconds, which looks good. I will post the
>> patch after some more tests.
>>
>> As for RELENG_7 and HEAD, I'm not 100% sure whether we should restore
>> the compatibility as 1) 7.0 is not released yet, 2) we don't promise
>> anything in
>> HEAD branch. However, if most people think get rid of inline stuffs and
>> have libc compatibility are nice, then we do the same for those two branches.
>
> After some tests, the patch is at
>
> http://people.freebsd.org/~rafan/ctype-abi-fix-6.diff

Why do we need to expose __mb_sb_limit at all even in 7.x or HEAD?
It doesn't seem like it can be anything greater than _CACHED_RUNES,
so why don't we always just ensure that __runetype, __maplower,
etc are all sized appropriately.  In the error case (_c >= 
__mb_sb_limit), we just return 0 anyways, so if unused __runetype[]
were initialized to 0 in the implementation for unused entries, this 
__sbmaskrune() could become:

 	__sbmaskrune(__ct_rune_t _c, unsigned long _f)
 	{
 		return (_c < 0 || _c >= _CACHED_RUNES) ? 0 :
 		    _CurrentRuneLocale->__runetype[_c] & _f;
 	}

-- 
DE


More information about the cvs-src mailing list