[Oisf-devel] memcmp versus SCMemcmp

Victor Julien victor at inliniac.net
Wed Nov 28 17:05:03 UTC 2012


On 11/28/2012 06:01 PM, David Mandelberg wrote:
> Hi,
> 
> I'm working on adding some events to src/decode-icmpv4.c and
> src/decode-icmpv6.c, and I want to compare IP addresses for
> (non-)equality only. I noticed that there's a function SCMemcmp that
> seems to do what I want, but I wasn't sure. Should I use plain old
> memcmp, or SCMemcmp? Does it matter?

SCMemcmp should behave the same, only faster (or the same). Where
available we use SSE3, SSE4.1 or SSE4.2 optimized versions. If none of
those are available, we fall back to plain memcmp.

-- 
---------------------------------------------
Victor Julien
http://www.inliniac.net/
PGP: http://www.inliniac.net/victorjulien.asc
---------------------------------------------




More information about the Oisf-devel mailing list