Functions | |
| static qnode_t * | alloc_init_node (void *data) |
| q_t * | queue_init (void) |
| qnode_t * | enqueue (q_t *q, void *data) |
| qnode_t * | queue_move_to_tail_of (q_t *from_q, q_t *to_q, qnode_t *nodenode) |
| Move node from one queue to another without memory reallocation. | |
| qnode_t * | queue_move_to_tail (q_t *q, qnode_t *nodenode) |
| Move existing node to tail (MRU) without reallocation. | |
| qnode_t * | prequeue (q_t *q, void *data) |
| void * | dequeue (q_t *q) |
| void | queue_destroy (q_t *q, void(*callback)(void *)) |
Netatalk utility functions: queue
|
static |
| void * dequeue | ( | q_t * | q | ) |
Take from head
| void queue_destroy | ( | q_t * | q, |
| void(* | callback )(void *) ) |
| q_t * queue_init | ( | void | ) |
Move existing node to tail (MRU) without reallocation.
This function provides O(1) move-to-tail operation without malloc/free overhead. Used by ARC cache to efficiently update T2 on cache hits.
| [in] | q | Queue (circular doubly-linked list with sentinel) |
| [in] | node | Node to move to tail (must currently be in queue q) |
Move node from one queue to another without memory reallocation.
Removes node from source queue and adds it to tail of destination queue. The node pointer remains valid and unchanged - enables zero-allocation transitions between ARC lists (T1→T2, T1→B1, T2→B2, B1→T2, B2→T2).
| [in] | from_q | Source queue (node must be in this queue) |
| [in] | to_q | Destination queue |
| [in] | node | Node to move |