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] PPC64 enable hp-timing 3rd try


On Sun, 2005-10-30 at 17:18 -0800, Roland McGrath wrote:
> You can't be calling malloc in there.  (clock_gettime is reentrant.)
> A small stack buffer is fine, you just have to read in a loop.
> The i386 code ought to do the same, in case of zillions of CPUs.

Yup, a loop with a little care in case the string you search is half
way over two read's... like a buffer of 8k, read one half, memmove, read
one, memmove, ... That way, you always have the current one appended to
the previous one, and unless you string is gigantic, it should work.

Ben.
 


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