list: check against double node insertion
authorbernie <bernie@38d2e660-2303-0410-9eaa-f027e97ec537>
Wed, 3 Sep 2008 08:05:55 +0000 (08:05 +0000)
committerbernie <bernie@38d2e660-2303-0410-9eaa-f027e97ec537>
Wed, 3 Sep 2008 08:05:55 +0000 (08:05 +0000)
commit9002e60f9cc2f2112180d706abe7dfc4f14ebf0f
treed90589f6f8168abd96c868c668e7da4b504d2f7b
parent2d10fd4d68d3f4086899ed44cfe12c5d309d1fb7
list: check against double node insertion

Tighten debug consistency checks in ADDHEAD(), ADDTAIL() and ENQUEUE()
through the macro LIST_ASSERT_NOT_CONTAINS().  Suggestions for a
better name very welcome.

This check is expensive (O(n)) and too permissive, as what we should
really check for is the node not being already part of *any* list.

This could be simplified by changing the list API to demand
pre-initialization of the node pointers to NULL.

git-svn-id: https://src.develer.com/svnoss/bertos/trunk@1772 38d2e660-2303-0410-9eaa-f027e97ec537
bertos/struct/list.h