This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc 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 1/9] Add vectorized getenv for glibc use


On Thu, May 02, 2013 at 04:27:24PM -0700, Andi Kleen wrote:
> From: Andi Kleen <ak@linux.intel.com>
> 
> This adds a general "vectorized getenv" for glibc internal use.
> The motivation is to allow subsystems to access environment variables
> cheaply without having to rescan the environment completely.
> 
> The dynamic linker already walks the environment to look for its
> LD_* variables. Extend this code to look for a number of
> pre-registered GLIBC_* variables too. This can be done at basically
> no additional cost. The only two variables currently pre-registered
> are for the lock elision code.
> 
> For static builds which do not use the dynamic linker a similar
> environment walking function is called at init time.
> 
> The variable values are saved in a global array that can be directly
> accessed by libc and related libraries like libpthread.

Doesn't this change behavior if environment variables are later set at
runtime? I don't think such use should be supported anyway, but it
seems this is an observable functional change, not just an
optimization.

Rich


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