Re: [PATCH] import memmem() with linear complexity from Gnulib

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, Feb 28, 2009 at 08:16:55PM +0100, René Scharfe wrote:
> Gnulib and glibc have gained a memmem() implementation using the Two-Way
> algorithm, which needs constant space and linear time.  Import it to
> compat/ in order to replace the simple quadratic implementation there.
> 
> memmem.c and str-two-way.h are copied verbatim from the repository at
> git://git.savannah.gnu.org/gnulib.git, with the following changes to
> memmem.c to make it fit into git's build environment:
> 
> 	21,23c21
> 	< #ifndef _LIBC
> 	< # include <config.h>
> 	< #endif
> 	---
> 	> #include "../git-compat-util.h"
> 	40c38
> 	< memmem (const void *haystack_start, size_t haystack_len,
> 	---
> 	> gitmemmem(const void *haystack_start, size_t haystack_len,
> 
> Signed-off-by: Rene Scharfe <rene.scharfe@xxxxxxxxxxxxxx>
> ---
>  Makefile             |    1 +
>  compat/memmem.c      |  103 +++++++++----
>  compat/str-two-way.h |  429 ++++++++++++++++++++++++++++++++++++++++++++++++++
>  3 files changed, 504 insertions(+), 29 deletions(-)

Seeing how much memmem is being used in the codebase, is it really worth?

Mike
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux