Re: [PATCH] areadlink-with-size: guess a lower bound with 0 size

2019-07-05 Thread Bruno Haible
Pádraig Brady wrote: > + areadlink-with-size: guess a lower bound with 0 size The patch looks good to me. Except that now, with the shrink-before-return in place, the term "lower bound" is no longer appropriate. A better term is probably "Initial memory allocation". Bruno

Re: [PATCH] areadlink-with-size: guess a lower bound with 0 size

2019-07-05 Thread Jim Meyering
On Thu, Jul 4, 2019 at 4:24 AM Pádraig Brady wrote: > BTW this would allocate more for empty symlinks, > but they're rare: https://lwn.net/Articles/551224/ Interesting (re)reading. Patch looks fine. Thanks.

[PATCH] areadlink-with-size: guess a lower bound with 0 size

2019-07-04 Thread Pádraig Brady
ink-with-size: guess a lower bound with 0 size * lib/areadlink-with-size.c (areadlink_with_size): The size is usually taken from st_size, which can be zero, resulting in inefficient operation as seen with: $ strace -e readlink stat -c %N /proc/$$/cwd readlink("/proc/9036/cwd"