Optimize memory allocation to use alloca when possible.
[gnulib.git] / ChangeLog
index 4250e19..d8a45a8 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,144 @@
 2007-02-11  Bruno Haible  <bruno@clisp.org>
 
+       * lib/c-strstr.c: Include allocsa.h.
+       (knuth_morris_pratt): Use allocsa/freesa instead of malloc/free.
+       * lib/c-strcasestr.c: Include allocsa.h.
+       (knuth_morris_pratt): Use allocsa/freesa instead of malloc/free.
+       * lib/strcasestr.c: Include allocsa.h.
+       (knuth_morris_pratt): Use allocsa/freesa instead of malloc/free.
+       * lib/mbsstr.c: Include allocsa.h.
+       (knuth_morris_pratt_unibyte, knuth_morris_pratt_multibyte): Use
+       allocsa/freesa instead of malloc/free.
+       * lib/mbscasestr.c: Include allocsa.h.
+       (knuth_morris_pratt_unibyte, knuth_morris_pratt_multibyte): Use
+       allocsa/freesa instead of malloc/free.
+       * modules/c-strstr (Depends-on): Add allocsa.
+       * modules/c-strcasestr (Depends-on): Likewise.
+       * modules/strcasestr (Depends-on): Likewise.
+       * modules/mbsstr (Depends-on): Likewise.
+       * modules/mbscasestr (Depends-on): Likewise.
+
+2007-02-11  Bruno Haible  <bruno@clisp.org>
+
+       * lib/mbsspn.c (mbsspn): Fix bug. Remove unnecessary strlen call.
+
+       * modules/mbsspn-tests: New file.
+       * tests/test-mbsspn.sh: New file.
+       * tests/test-mbsspn.c: New file.
+
+2007-02-11  Bruno Haible  <bruno@clisp.org>
+
+       * lib/mbspbrk.c (mbspbrk): Remove unneeded cast.
+
+       * modules/mbspbrk-tests: New file.
+       * tests/test-mbspbrk.sh: New file.
+       * tests/test-mbspbrk.c: New file.
+
+2007-02-11  Bruno Haible  <bruno@clisp.org>
+
+       * lib/mbscspn.c (mbscspn): Remove unnecessary strlen call and
+       unneeded cast.
+
+       * modules/mbscspn-tests: New file.
+       * tests/test-mbscspn.sh: New file.
+       * tests/test-mbscspn.c: New file.
+
+2007-02-11  Bruno Haible  <bruno@clisp.org>
+
+       * modules/mbscasecmp-tests: New file.
+       * tests/test-mbscasecmp.sh: New file.
+       * tests/test-mbscasecmp.c: New file.
+
+2007-02-11  Bruno Haible  <bruno@clisp.org>
+
+       Ensure O(n) worst-case complexity of mbscasestr.
+       * lib/mbscasestr.c: Include stdbool.h.
+       (knuth_morris_pratt_unibyte, knuth_morris_pratt_multibyte): New
+       functions.
+       (mbscasestr): Add some bookkeeping. Invoke knuth_morris_pratt_* when
+       the bookkeeping indicates that it's worth it.
+       * modules/mbscasestr (Depends-on): Add stdbool, mbslen, strnlen.
+
+       * modules/mbscasestr-tests: New file.
+       * tests/test-mbscasestr1.c: New file.
+       * tests/test-mbscasestr2.sh: New file.
+       * tests/test-mbscasestr2.c: New file.
+       * tests/test-mbscasestr3.sh: New file.
+       * tests/test-mbscasestr3.c: New file.
+       * tests/test-mbscasestr4.sh: New file.
+       * tests/test-mbscasestr4.c: New file.
+
+2007-02-11  Bruno Haible  <bruno@clisp.org>
+
+       Ensure O(n) worst-case complexity of mbsstr.
+       * lib/mbsstr.c: Include stdbool.h.
+       (knuth_morris_pratt_unibyte, knuth_morris_pratt_multibyte): New
+       functions.
+       (mbsstr): Add some bookkeeping. Invoke knuth_morris_pratt_* when the
+       bookkeeping indicates that it's worth it.
+       * modules/mbsstr (Depends-on): Add stdbool, mbslen, strnlen.
+
+       * modules/mbsstr-tests: New file.
+       * tests/test-mbsstr1.c: New file.
+       * tests/test-mbsstr2.sh: New file.
+       * tests/test-mbsstr2.c: New file.
+       * tests/test-mbsstr3.sh: New file.
+       * tests/test-mbsstr3.c: New file.
+       * m4/locale-fr.m4: New file.
+
+2007-02-11  Bruno Haible  <bruno@clisp.org>
+
+       * lib/mbsrchr.c (mbsrchr): Fix bug.
+
+       * modules/mbsrchr-tests: New file.
+       * tests/test-mbsrchr.sh: New file.
+       * tests/test-mbsrchr.c: New file.
+
+2007-02-11  Bruno Haible  <bruno@clisp.org>
+
+       * lib/mbschr.c (mbschr): Fix bug.
+
+       * modules/mbschr-tests: New file.
+       * tests/test-mbschr.sh: New file.
+       * tests/test-mbschr.c: New file.
+       * m4/locale-zh.m4: New file.
+
+2007-02-11  Bruno Haible  <bruno@clisp.org>
+
+       Support for copying multibyte string iterators.
+       * lib/mbiter.h: Include <string.h>.
+       (mbiter_multi_copy): New function.
+       (mbi_copy): New macro.
+       * lib/mbuiter.h: Include <string.h>.
+       (mbuiter_multi_copy): New function.
+       (mbui_copy): New macro.
+
+2007-02-11  Bruno Haible  <bruno@clisp.org>
+
+       New module mbslen.
+       * modules/mbslen: New file.
+       * lib/mbslen.c: New file.
+       * lib/string_.h (mbslen): New declaration.
+       * m4/mbslen.m4: New file.
+       * m4/string_h.m4 (gl_STRING_MODULE_INDICATOR_DEFAULTS): Initialize
+       GNULIB_MBSLEN.
+       * modules/string (string.h): Also substitute GNULIB_MBSLEN.
+       * MODULES.html.sh (Internationalization functions): Add mbslen.
+
+2007-02-11  Bruno Haible  <bruno@clisp.org>
+
+       Ensure O(n) worst-case complexity of strcasestr substitute.
+       * lib/strcasestr.c: Include stdbool.h.
+       (knuth_morris_pratt): New function.
+       (strcasestr): Add some bookkeeping. Invoke knuth_morris_pratt when the
+       bookkeeping indicates that it's worth it.
+       * modules/strcasestr (Depends-on): Add stdbool, strnlen.
+
+       * modules/strcasestr-tests: New file.
+       * tests/test-strcasestr.c: New file.
+
+2007-02-11  Bruno Haible  <bruno@clisp.org>
+
        Ensure O(n) worst-case complexity of c_strcasestr.
        * lib/c-strcasestr.c: Include stdbool.h, string.h.
        (knuth_morris_pratt): New function.