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
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
> 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
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