From c3860a9f29db08083b8addf9efb23bd01f94bb99 Mon Sep 17 00:00:00 2001 From: Justin Viiret Date: Thu, 11 Feb 2016 16:51:59 +1100 Subject: [PATCH] NFA API: Remove unused scratch ptr from struct mq --- src/nfa/nfa_api_queue.h | 1 - src/scratch.c | 5 ----- unit/internal/lbr.cpp | 3 +-- unit/internal/limex_nfa.cpp | 2 -- 4 files changed, 1 insertion(+), 10 deletions(-) diff --git a/src/nfa/nfa_api_queue.h b/src/nfa/nfa_api_queue.h index 59c18fca..1373425d 100644 --- a/src/nfa/nfa_api_queue.h +++ b/src/nfa/nfa_api_queue.h @@ -91,7 +91,6 @@ struct mq { * history buffer; (logically) immediately before the * main buffer */ size_t hlength; /**< length of the history buffer */ - struct hs_scratch *scratch; /**< global scratch space */ char report_current; /**< * report_current matches at starting offset through * callback. If true, the queue must be located at a diff --git a/src/scratch.c b/src/scratch.c index 5771c8a7..854fc312 100644 --- a/src/scratch.c +++ b/src/scratch.c @@ -242,11 +242,6 @@ hs_error_t alloc_scratch(const hs_scratch_t *proto, hs_scratch_t **scratch) { // Don't get too big for your boots assert((size_t)(current - (char *)s) <= alloc_size); - // Init q->scratch ptr for every queue. - for (struct mq *qi = s->queues; qi != s->queues + queueCount; ++qi) { - qi->scratch = s; - } - return HS_SUCCESS; } diff --git a/unit/internal/lbr.cpp b/unit/internal/lbr.cpp index 00606141..be53d9f3 100644 --- a/unit/internal/lbr.cpp +++ b/unit/internal/lbr.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Intel Corporation + * Copyright (c) 2015-2016, Intel Corporation * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -120,7 +120,6 @@ protected: q.length = 0; // filled in by test q.history = nullptr; q.hlength = 0; - q.scratch = nullptr; // not needed by LBR q.report_current = 0; q.cb = onMatch; q.som_cb = nullptr; // only used by Haig diff --git a/unit/internal/limex_nfa.cpp b/unit/internal/limex_nfa.cpp index 679dc670..7c0b66e4 100644 --- a/unit/internal/limex_nfa.cpp +++ b/unit/internal/limex_nfa.cpp @@ -104,7 +104,6 @@ protected: q.length = SCAN_DATA.size(); q.history = nullptr; q.hlength = 0; - q.scratch = scratch.get(); q.report_current = 0; q.cb = onMatch; q.som_cb = nullptr; // only used by Haig @@ -420,7 +419,6 @@ protected: q.length = ZOMBIE_SCAN_DATA.length(); q.history = nullptr; q.hlength = 0; - q.scratch = scratch.get(); q.report_current = 0; q.cb = onMatch; q.som_cb = nullptr; // only used by Haig