From: Victor Julien Date: Tue, 1 Oct 2019 10:07:05 +0000 (+0200) Subject: classtype: small memory reduction X-Git-Tag: suricata-5.0.0~74 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ccf6c5a6ef96615819699b204fbc922f3ddfe20f;p=thirdparty%2Fsuricata.git classtype: small memory reduction Reduce memory use by making sure SCClassConfClasstype has a more optimal memory layout. --- diff --git a/src/util-classification-config.c b/src/util-classification-config.c index 2b026d25ca..a59624af6f 100644 --- a/src/util-classification-config.c +++ b/src/util-classification-config.c @@ -574,7 +574,7 @@ SCClassConfClasstype *SCClassConfGetClasstype(const char *ct_name, name[s] = tolower((unsigned char)ct_name[s]); name[s] = '\0'; - SCClassConfClasstype ct_lookup = {0, name, NULL, 0 }; + SCClassConfClasstype ct_lookup = {0, 0, name, NULL }; SCClassConfClasstype *lookup_ct_info = HashTableLookup(de_ctx->class_conf_ht, &ct_lookup, 0); return lookup_ct_info; diff --git a/src/util-classification-config.h b/src/util-classification-config.h index 57d76b95dc..e35e992e18 100644 --- a/src/util-classification-config.h +++ b/src/util-classification-config.h @@ -31,15 +31,15 @@ typedef struct SCClassConfClasstype_ { /* The index of the classification within classification.confg */ uint8_t classtype_id; + /* The priority this classification type carries */ + int priority; + /* The classtype name. This is the primary key for a Classification. */ char *classtype; /* Description for a classification. Would be used while printing out * the classification info for a Signature, by the fast-log module. */ char *classtype_desc; - - /* The priority this classification type carries */ - int priority; } SCClassConfClasstype; void SCClassConfLoadClassficationConfigFile(DetectEngineCtx *, FILE *fd);