summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2021-01-08 17:17:32 -0800
committerPaul Eggert <eggert@cs.ucla.edu>2021-01-08 17:17:57 -0800
commit87ed1f9c4bc4ae9e98e1293465a5b3a929b9c3f9 (patch)
treecaae83fb9efbe7ba0c597e19a2346104766714ce /lib
parent1731fef3d6d883bc8619c468a1a69b1d090a95c1 (diff)
downloadgnulib-87ed1f9c4bc4ae9e98e1293465a5b3a929b9c3f9.tar.gz
regex: stop using alloca
* lib/regex_internal.h: Do not include <alloca.h> or define __libc_use_alloca or alloca. Patch written by Adhemerval Zanella: https://sourceware.org/pipermail/libc-alpha/2021-January/121374.html * modules/regex (Depends-on): Remove alloca-opt.
Diffstat (limited to 'lib')
-rw-r--r--lib/regex_internal.h19
1 files changed, 0 insertions, 19 deletions
diff --git a/lib/regex_internal.h b/lib/regex_internal.h
index 5d4d5fe2b3..b4f91d9ec7 100644
--- a/lib/regex_internal.h
+++ b/lib/regex_internal.h
@@ -445,25 +445,6 @@ typedef struct re_dfa_t re_dfa_t;
#define re_string_skip_bytes(pstr,idx) ((pstr)->cur_idx += (idx))
#define re_string_set_index(pstr,idx) ((pstr)->cur_idx = (idx))
-#if defined _LIBC || HAVE_ALLOCA
-# include <alloca.h>
-#endif
-
-#ifndef _LIBC
-# if HAVE_ALLOCA
-/* The OS usually guarantees only one guard page at the bottom of the stack,
- and a page size can be as small as 4096 bytes. So we cannot safely
- allocate anything larger than 4096 bytes. Also care for the possibility
- of a few compiler-allocated temporary stack slots. */
-# define __libc_use_alloca(n) ((n) < 4032)
-# else
-/* alloca is implemented with malloc, so just use malloc. */
-# define __libc_use_alloca(n) 0
-# undef alloca
-# define alloca(n) malloc (n)
-# endif
-#endif
-
#ifdef _LIBC
# define MALLOC_0_IS_NONNULL 1
#elif !defined MALLOC_0_IS_NONNULL