classtype: small memory reduction

Reduce memory use by making sure SCClassConfClasstype
has a more optimal memory layout.
pull/4288/head
Victor Julien 6 years ago
parent 26e2370f99
commit ccf6c5a6ef

@ -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;

@ -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);

Loading…
Cancel
Save