结构体UT_LIST_ADD_LAST

使用 UT_LIST_ADD_LAST(list, buf_pool->free, (&block->page));

/*******************************************************************//**
Adds the node as the last element in a two-way linked list.
@param NAME    list name
@param BASE    the base node (not a pointer to it)
@param N    pointer to the node to be added to the list
*/
#define UT_LIST_ADD_LAST(NAME, BASE, N)\
{\
    ut_ad(N != NULL);\
    ((BASE).count)++;\
    ((N)->NAME).prev = (BASE).end;\
    ((N)->NAME).next = NULL;\
    if ((BASE).end != NULL) {\
        ut_ad((BASE).end != (N));\
        (((BASE).end)->NAME).next = (N);\
    }\
    (BASE).end = (N);\
    if ((BASE).start == NULL) {\
        (BASE).start = (N);\
    }\
}\
上一篇:承诺c指针 (1)指针是地址


下一篇:HDU 3829 Cat VS Dog (最大独立集)【二分图匹配】