git.haldean.org ubik / 4414fdb
restore jobq node recycler Haldean Brown 5 years ago
1 changed file(s) with 4 addition(s) and 6 deletion(s). Raw diff Collapse all Expand all
126126
127127 elem = n->elem;
128128
129 /*
130129 n->elem = NULL;
130 n->left = NULL;
131131 n->right = sq->recycle;
132132 sq->recycle = n;
133 */
134 free(n);
135133
136134 return elem;
137135 }
144142 n = *head;
145143 while (n != NULL)
146144 {
147 *head = n->left;
145 *head = n->right;
148146 free(n);
149147 n = *head;
150148 }
159157 for (i = 0; i < q->n_queues; i++)
160158 {
161159 sq = q->qs + i;
162 free_ll(&sq->head);
160 free_ll(&sq->tail);
163161 free_ll(&sq->recycle);
164162 }
165 free_ll(&q->global_head);
163 free_ll(&q->global_tail);
166164 free(q->qs);
167165 }
168166