ensure links only belong to 1 list
also some small documentation changes.
This commit is contained in:
@@ -57,6 +57,10 @@ int main (void)
|
||||
t->data3 = rand() % UINT64_MAX;
|
||||
t->data4 = rand() % UINT64_MAX;
|
||||
|
||||
// ensure our link points at nothing.
|
||||
t->link.next = NULL;
|
||||
t->link.prev = NULL;
|
||||
|
||||
ni_list__push_back(&data_instances, &(t->link));
|
||||
|
||||
printf("write: n = %d: %ld %ld %ld %ld \n\tnext: %p\n\tprev: %p\n",
|
||||
@@ -75,6 +79,7 @@ int main (void)
|
||||
}
|
||||
}
|
||||
|
||||
// drain from back of list and remove then free entries
|
||||
while (!ni_list__is_empty(&data_instances)) {
|
||||
ni_list_node* tail = ni_list__get_back(&data_instances);
|
||||
ni_list__remove(&data_instances, tail);
|
||||
|
||||
Reference in New Issue
Block a user