Skip to content

Commit 95b252e

Browse files
committed
Update nfpcapd - Replace ever growing node cache with an adaptive slab allocator
1 parent edd6784 commit 95b252e

8 files changed

Lines changed: 293 additions & 99 deletions

File tree

src/libnffile/queue.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,8 @@ void *queue_pop(queue_t *queue);
8787

8888
void *queue_try_pop(queue_t *q);
8989

90+
void *queue_pop_timed(queue_t *q, const struct timespec *abstime);
91+
9092
void queue_close(queue_t *queue);
9193

9294
void queue_sync(queue_t *queue);

src/nfpcapd/flowdump.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -361,6 +361,7 @@ __attribute__((noreturn)) void *flow_thread(void *thread_data) {
361361
int done = 0;
362362
while (!done) {
363363
struct FlowNode *Node = Pop_Node(flowParam->NodeList);
364+
dbg_assert(Node->memflag == NODE_IN_USE);
364365
switch (Node->nodeType) {
365366
case FLOW_NODE:
366367
StorePcapFlow(flowParam, Node);
@@ -393,6 +394,7 @@ __attribute__((noreturn)) void *flow_thread(void *thread_data) {
393394
done = 1;
394395
break;
395396
default:
397+
dbg_assert(0);
396398
LogError("Unknown node type: %u\n", Node->nodeType);
397399
}
398400

0 commit comments

Comments
 (0)