Re: [patch] inline __getreent in newlib

2007-09-06 Thread Brian Dessent
CC'd to newlib: I've checked in the attached change to libc/reent/getreent.c as obvious, please let me know if it breaks anything. Christopher Faylor wrote: > So, I guess I'll come down on the side of speed over clarity. I'm sure > that Jeff won't mind your checking in the undef in newlib. So,

Re: [patch] inline __getreent in newlib

2007-09-06 Thread Christopher Faylor
On Thu, Sep 06, 2007 at 04:38:04PM -0700, Brian Dessent wrote: > >I noticed today that all instances of _REENT in newlib go through a >function call to __getreent(). All this function does is get the value >of %fs:4 and subtract a fixed offset from it, so this seems rather >wasteful. And we alrea

[patch] inline __getreent in newlib

2007-09-06 Thread Brian Dessent
I noticed today that all instances of _REENT in newlib go through a function call to __getreent(). All this function does is get the value of %fs:4 and subtract a fixed offset from it, so this seems rather wasteful. And we already have the required value of this offset computed for us in tlsoffs

Re: [patch] Fix multithreaded snprintf

2007-09-06 Thread Christopher Faylor
On Thu, Sep 06, 2007 at 11:53:02AM -0700, Brian Dessent wrote: >Christopher Faylor wrote: >> Nice catch! > >I wish I could say I caught this by inspection but it was only by single >stepping through python guts that it became apparent what was going on. Better you than me. :-) cgf

Re: [patch] Fix multithreaded snprintf

2007-09-06 Thread Brian Dessent
Christopher Faylor wrote: > Go ahead and check this in but could you add a comment indicating that > this part of include/sys/stdio.h has to be kept in sync with newlib? Done. > Nice catch! I wish I could say I caught this by inspection but it was only by single stepping through python guts tha

Re: [patch] Fix multithreaded snprintf

2007-09-06 Thread Christopher Faylor
On Thu, Sep 06, 2007 at 11:30:17AM -0700, Brian Dessent wrote: > >I tracked down the problem reported in >. The crash was >occuring in pthread_mutex_lock, but that's a bit of a red herring. The >real problem is that both newlib and Cygwin pro

[patch] Fix multithreaded snprintf

2007-09-06 Thread Brian Dessent
I tracked down the problem reported in . The crash was occuring in pthread_mutex_lock, but that's a bit of a red herring. The real problem is that both newlib and Cygwin provide a include/sys/stdio.h file, however they were out of sync with