summaryrefslogtreecommitdiff
path: root/m4
diff options
context:
space:
mode:
authorMark H Weaver <mhw@netris.org>2019-05-06 21:11:26 -0400
committerAndy Wingo <wingo@pobox.com>2019-05-23 17:51:36 +0200
commitbd50407d1f9adc3eedd6687c9a84aa7a503b7ce1 (patch)
treef192426504933a93f0fca52afebd1e8ea67244fe /m4
parent2bfa4f73f188e4ad2bde22594d5173e71c1d3d2f (diff)
downloadguile-bd50407d1f9adc3eedd6687c9a84aa7a503b7ce1.tar.gz
Strings, i18n: Limit the use of alloca to approximately 8 kilobytes.
* libguile/i18n.c (SCM_MAX_ALLOCA): New macro. (SCM_STRING_TO_U32_BUF): Accept an additional variable to remember whether we used malloc to allocate the buffer. Use malloc if the allocation size is greater than SCM_MAX_ALLOCA. (SCM_CLEANUP_U32_BUF): New macro. (compare_u32_strings, compare_u32_strings_ci, str_to_case): Adapt. * libguile/strings.c (SCM_MAX_ALLOCA): New macro. (normalize_str, unistring_escapes_to_r6rs_escapes): Use malloc if the allocation size is greater than SCM_MAX_ALLOCA. * test-suite/tests/i18n.test, test-suite/tests/strings.test: Add tests.
Diffstat (limited to 'm4')
0 files changed, 0 insertions, 0 deletions