This is the mail archive of the
glibc-bugs@sourceware.org
mailing list for the glibc project.
Re: [Bug libc/17087] New: Implement memcasemem()
- From: OndÅej BÃlka <neleai at seznam dot cz>
- To: kenatmit at gmail dot com <sourceware-bugzilla at sourceware dot org>
- Cc: glibc-bugs at sourceware dot org
- Date: Wed, 25 Jun 2014 18:40:07 +0200
- Subject: Re: [Bug libc/17087] New: Implement memcasemem()
- Authentication-results: sourceware.org; auth=none
- References: <bug-17087-131 at http dot sourceware dot org/bugzilla/>
On Wed, Jun 25, 2014 at 03:19:01PM +0000, kenatmit at gmail dot com wrote:
>
> The of function strstr() has the case-insensitive version strcasestr(), but
> memmem() does not have the case-insensitive version memcasemem().
>
> The memcasemem() version would be useful for optimizing some programs. For
> example Suricata intrustion prevetion and detection code.
>
That would not help as optimization, a case conversion is more expensive
than detecting end condition and in vectorized implementations it is
faster to detect terminating null than add special casing if detected
byte was before or after end.