Skip to content

Commit

Permalink
main pb free prepends obj to queue
Browse files Browse the repository at this point in the history
  • Loading branch information
yasukata committed Nov 4, 2023
1 parent d5d009a commit 6cecf23
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion main.c
Expand Up @@ -463,7 +463,19 @@ static void __iip_free_pb(struct workspace *s, struct pb *p, void *opaque)
if (p->orig_pkt)
iip_ops_pkt_free(p->orig_pkt, opaque);
__iip_memset(p, 0, sizeof(struct pb));
__iip_enqueue_obj(s->pool.p, p, 0);
#define __iip_enqueue_obj_top(__queue, __obj, __x) \
do { \
(__obj)->prev[__x] = (__obj)->next[__x] = (void *) 0; \
if (!((__queue)[0])) { \
(__queue)[0] = (__queue)[1] = (__obj); \
} else { \
(__queue)[0]->prev[__x] = (__obj); \
(__obj)->next[__x] = (__queue)[0]; \
(__queue)[0] = (__obj); \
} \
} while (0)
__iip_enqueue_obj_top(s->pool.p, p, 0);
#undef __iip_enqueue_obj_top
s->pool.p_cnt++;
}

Expand Down

0 comments on commit 6cecf23

Please sign in to comment.