From: Shivani Bhardwaj Date: Tue, 16 Jan 2024 08:40:59 +0000 (+0530) Subject: detect: remove unneeded size in DetectEngineCtx X-Git-Tag: suricata-8.0.0-beta1~1830 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=588af05565e2f52f5b1f758312e18c1567dbb993;p=thirdparty%2Fsuricata.git detect: remove unneeded size in DetectEngineCtx sig_array_size can easily be calculated with length and is only used at one place for debugging purposes. Remove it from the DetectEngineCtx struct to avoid making it unnecessarily heavy. --- diff --git a/src/detect-engine-build.c b/src/detect-engine-build.c index 6a1c531136..604164b21c 100644 --- a/src/detect-engine-build.c +++ b/src/detect-engine-build.c @@ -1361,14 +1361,10 @@ int SigPrepareStage1(DetectEngineCtx *de_ctx) } de_ctx->sig_array_len = DetectEngineGetMaxSigId(de_ctx); - de_ctx->sig_array_size = (de_ctx->sig_array_len * sizeof(Signature *)); de_ctx->sig_array = (Signature **)SCCalloc(de_ctx->sig_array_len, sizeof(Signature *)); if (de_ctx->sig_array == NULL) goto error; - SCLogDebug("signature lookup array: %" PRIu32 " sigs, %" PRIu32 " bytes", - de_ctx->sig_array_len, de_ctx->sig_array_size); - /* now for every rule add the source group */ for (Signature *s = de_ctx->sig_list; s != NULL; s = s->next) { de_ctx->sig_array[s->num] = s; diff --git a/src/detect.h b/src/detect.h index 181ae22923..9b7b58794e 100644 --- a/src/detect.h +++ b/src/detect.h @@ -850,7 +850,6 @@ typedef struct DetectEngineCtx_ { SRepCIDRTree *srepCIDR_ctx; Signature **sig_array; - uint32_t sig_array_size; /* size in bytes */ uint32_t sig_array_len; /* size in array members */ uint32_t signum;