Messages in this thread | | | Date | Thu, 26 Sep 2002 12:45:35 -0600 (MDT) | From | Thunder from the hill <> | Subject | Re: [PATCH][2.5] Single linked lists for Linux, overly complicated v2 |
| |
Hi,
My point is:
We don't know the parent structure. We shouldn't know it, since it takes time. So I try to keep the address pointer stable instead of just exchanging pointers.
That's why I'm exchanging pointers, and that's also why slist_del() currently returns a value: because the deleted list entry would otherwise be lost in space...
If any applicator needs to know a list header (primer), he shall produce one and pass the first entry after the primer. We should only depend on one single facility: the next field of the handled structure.
Also notice that we can restart list_for_each*() from any position.
Thunder -- assert(typeof((fool)->next) == typeof(fool)); /* wrong */
- 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/
| |