【发布时间】:2013-05-02 16:17:53
【问题描述】:
我正在从 FreeBSD 学习 sys/queue.h,我有一个问题:
在sys/queue.h中,LIST_ENTRY定义如下:
#define LIST_ENTRY(type) \
struct { \
struct type *le_next; /* next element */ \
struct type **le_prev; /* address of previous next element */ \
}
为什么它维护前一个元素的地址(struct type **le_prev)而不是像struct type *le_prev那样简单的previous elment?
【问题讨论】:
标签: c struct queue doubly-linked-list bsd