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 v2] Add __pure2 to __locale_ctype_ptr(_l)


On Nov  7 21:29, Wilco Dijkstra wrote:
> Sebastian Huber wrote:
> 
> > Why don't we make
> > 
> > const char *
> > __locale_ctype_ptr (void)
> > {
> >   return __get_current_locale ()->ctype_ptr;
> > }
> >
> > inline?
> >
> > Why do we need the condition in:
> >
> > _ELIDABLE_INLINE struct __locale_t *
> > __get_current_locale (void)
> > {
> >   return _REENT->_locale ?: __get_global_locale ();
> > }
> >
> > Can't we set _REENT->_locale to &__global_locale instead of NULL?
> > 
> > Systems using __getreent() would probably benefit from a __pure2 attribute.
> 
> Absolutely there is no reason not to inline all this. GLIBC has to maintain 
> a consistent ABI because of dynamic linking but that's not relevant to newlib.
> So for single-threaded we could do:
> 
> #define _REENT &_impure_data

No, the __getreent is supposed to hide the actual implementation.
Targets can easily redefine __getreent to be an inline function or
macro, just as they need it, there's no reason to change this.


Corinna

-- 
Corinna Vinschen
Cygwin Maintainer
Red Hat

Attachment: signature.asc
Description: PGP signature


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