Go to the source code of this file.
Data Structures | |
| struct | qnode |
Macros | |
| #define | queue_free(q) |
Typedefs | |
| typedef struct qnode | qnode_t |
| typedef qnode_t | q_t |
Functions | |
| q_t * | queue_init (void) |
| void | queue_destroy (q_t *q, void(*callback)(void *)) |
| qnode_t * | enqueue (q_t *q, void *data) |
| qnode_t * | prequeue (q_t *q, void *data) |
| qnode_t * | queue_move_to_tail (q_t *q, qnode_t *nodenode) |
| Move existing node to tail (MRU) without reallocation. | |
| 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. | |
| void * | dequeue (q_t *q) |
| #define queue_free | ( | q | ) |
|
extern |
Take from head
|
extern |
|
extern |
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 |