Re: ps realloc loop

2014-12-28 Thread Philip Guenther
On Sun, Dec 28, 2014 at 6:02 AM, Ted Unangst wrote: ... > Agreed. Here's a different approach. If we need more memory, allocate > the required amount. No realloc since we aren't interested in the > previous contents. Continue caching the previous allocation, but don't > worry about power of two si

Re: ps realloc loop

2014-12-28 Thread Ted Unangst
On Fri, Dec 26, 2014 at 11:21, Mark Kettenis wrote: >> Date: Fri, 26 Dec 2014 00:18:04 -0500 >> From: Ted Unangst >> >> Theo noticed that the realloc loop in ps is suboptimal. >> >> Mostly style change: overflow checking for "free" courtesy of >> reallocarray. Vageuly wasteful, but ps strings are

Re: ps realloc loop

2014-12-26 Thread Mark Kettenis
> Date: Fri, 26 Dec 2014 00:18:04 -0500 > From: Ted Unangst > > Theo noticed that the realloc loop in ps is suboptimal. > > Mostly style change: overflow checking for "free" courtesy of > reallocarray. Vageuly wasteful, but ps strings are small. > > Mostly functional change: there's no need to

ps realloc loop

2014-12-25 Thread Ted Unangst
Theo noticed that the realloc loop in ps is suboptimal. Mostly style change: overflow checking for "free" courtesy of reallocarray. Vageuly wasteful, but ps strings are small. Mostly functional change: there's no need to free the pointer if realloc fails; it will still be useful in the future. N