tech-toolchain archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: make(1): Unbalanced Lst_Open/Lst_Close in SuffFindCmds



On 09.09.2020 23:52, David Holland wrote:
> On Sun, Aug 30, 2020 at 03:37:22PM +0200, Roland Illig wrote:
>  > OpenBSD has fixed this by not using Lst_Open anymore:
>  > https://github.com/openbsd/src/blob/9424095da53ae512cc53b1ddd85c6375da9ebcfa/usr.bin/make/suff.c#L835
>
> Pity you didn't prod me to finish my changes from years ago to get rid
> of the list library entirely before embarking on all this cleanup... I
> guess that patchset is a dead article now.

Yeah, probably.  Given the low commit rate in usr.bin/make, I didn't
expect anyone to be actively working on cleaning up the code.

Your patch may no longer apply, but the ideas behind it are surely still
worth sharing.  How did you plan to get rid of the whole list library?
I trimmed it down to 30% of the original code, but I don't see how it
can be replaced entirely.

The GNode type uses this library quite a lot, and it may or may not
depend on modifying a list while iterating over it, I'm not sure yet.
Removing the code for circular lists was quite easy since none of the
code used that feature.  But other parts like concurrent modification
are harder to prove from just looking at the code.

I'd really like to remove Lst_Open/Lst_Close, as well as
ListNode.useCount and ListNode.deleted, but I don't know how to do that
reliably, given that the unit tests only cover 68% of the code.

Roland


Home | Main Index | Thread Index | Old Index