This is the mail archive of the libc-help@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]

Switch implementation based on circumstances.


Hi, 

I noticed that at several places we can use fast implementation most of
time and switch to more generic one only after some function is called.

This mostly applies to fact that in single thread programs locking is
not needed. I want to do something like compile file twice first time
with locks on and second off. Then I would and hook in pthread_create+shmat 
that switches implementation. 

malloc, printf ... would benefit most from this one.

Second is locale depended optimalizations where a hook for setlocale is
needed.

I do not know what is best way to collect hooks. One possibility is single 
file where you write all affected functions.


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