detect: prepare for SIMD optimizations

Make rule group head bitarray 16 bytes aligned and padded to 16 bytes
boundaries to assist SIMD operations in follow up commits.
pull/10569/head
Victor Julien 2 years ago committed by Victor Julien
parent e7e4305d91
commit 4ba1f44e0d

@ -64,7 +64,7 @@ void SigGroupHeadInitDataFree(SigGroupHeadInitData *sghid)
sghid->match_array = NULL;
}
if (sghid->sig_array != NULL) {
SCFree(sghid->sig_array);
SCFreeAligned(sghid->sig_array);
sghid->sig_array = NULL;
}
if (sghid->app_mpms != NULL) {
@ -92,9 +92,12 @@ static SigGroupHeadInitData *SigGroupHeadInitDataAlloc(uint32_t size)
return NULL;
/* initialize the signature bitarray */
sghid->sig_size = size;
if ((sghid->sig_array = SCCalloc(1, sghid->sig_size)) == NULL)
size = sghid->sig_size = size + 16 - (size % 16);
void *ptr = SCMallocAligned(sghid->sig_size, 16);
if (ptr == NULL)
goto error;
memset(ptr, 0, size);
sghid->sig_array = ptr;
return sghid;
error:

Loading…
Cancel
Save