This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: I'm unhappy about twalk_r
- From: Florian Weimer <fweimer at redhat dot com>
- To: DJ Delorie <dj at redhat dot com>
- Cc: libc-alpha at sourceware dot org
- Date: Fri, 17 May 2019 17:43:08 +0200
- Subject: Re: I'm unhappy about twalk_r
- References: <xnimucdhgl.fsf@greed.delorie.com>
* DJ Delorie:
> Florian Weimer <fweimer@redhat.com> writes:
>> Exposing this information using the VISIT argument seems wrong to me.
>
> I agree. It would be more useful if the binary-ness of the tree were
> *more* exposed, so the user could take advatage of the walk-order, but
> we don't expose it.
But it's really an implementation detail, dependent on how the
implementation chooses to rebalance the tree (if at all).
>> I think this is much more useful: It avoids pointless repeated calls to
>> ACTION, and it allows premature termination of the iteration.
>
> twalk() is defined by POSIX. If we have a *_r version of it, it should
> conform to the POSIX definition as closely as we can, despite these
> inefficiencies.
Hmm. Okay. Carlos said something similar, so I'm going to leave it
as-is.
Thanks,
Florian