Re: [PATCH][2.5] Single linked lists for Linux, overly complicated v2

From: Daniel Phillips (phillips@arcor.de)
Date: Tue Oct 01 2002 - 11:05:15 EST


On Monday 30 September 2002 22:04, Zach Brown wrote:
> but really, I think these are DOA.

No argument there.

> having to define a single magical
> structure member makes these more trouble than they're worth. I've come
> to prefer wli's 'struct list' approach. It has the added benefit of
> actually being sanely implementable with shared code, something
> ridiculously low memory setups might appreciate.

Have you tried it in a real program? I have. It's not nice to use.
My original response to Bill:

> > How's this look?
>
> Unfortunately, not good.  You get code like:
>
>         foo = (struct mylist *) slist_pop((slist *) &somelist->next);
>
> So type safety goes out the window, and you gain some niceness in the
> definition in exchange for ugliness in usage, the wrong tradeoff imho.

Single linked lists are so simple - just write the darn code out in
full. Yes, the fact that you can't sanely generalize these things shows
that C as a language falls a few cards short of a full deck, but we knew
that. It makes nice kernels, it does not make art.

-- 
Daniel

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Mon Oct 07 2002 - 22:00:26 EST