Re: [PATCH RFC] struct list_node

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

 




On Sun, 10 Jun 2007, Rusty Russell wrote:
>
> The current list.h has the same type for list elements and list heads
> even though most code and coders treat them as distinct.

I think the old list.h is technically superior to yours.

Exactly *because* nodes and heads are interchangeable.

In fact, you are incorrect that "most code" treat them as distinct. Most 
code that uses list.h in fact uses it as a list of entries, often without 
any head at all (and each *entry* is a point of removal), because the way 
to actually *find* the structure that contains the lists is separate from 
the lists themselves.

In other words, I think your patch is HORRIBLY BAD, because it totally 
obscures the beauty of the current list.h implementation, and makes it be 
something *average*.

The Linux kernel list.h is _better_ than most stupid list implementations 
that think that a head node is different from the list node. Exactly 
because it very naturally supports the notion of "this structure exists in 
a 'ring of entries'" where each node is 100% equivalent to any other node, 
and there _is_ no head.

And your patch totally misunderstands that, and breaks it.

Nack.

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

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux