#define __list_for_each(pos, head) \
for (pos = (head)->next; pos != (head); pos = pos->next)
#define list_for_each_safe(pos, n, head) \
for (pos = (head)->next, n = pos->next; pos != (head); \
pos = n, n = pos->next)
__list_for_each(....){
list_del(pos);
free(pos) ;//这样就用可能有问题
}
__list_for_each_safe(......){
list_del(pos);
free(pos) ;//safe 确保free 没问题
}
阅读(1813) | 评论(0) | 转发(1) |