[3/3] posix: Remove alloca definition from regex

Message ID 20210106181707.1738066-3-adhemerval.zanella@linaro.org
State Superseded
Headers
Series [1/3] posix: Remove alloca usage on regex set_regs |

Commit Message

Adhemerval Zanella Jan. 6, 2021, 6:17 p.m. UTC
  Since it is not used anymore.  No functional changes is expected.

Checked on x86_64-linux-gnu.
---
 posix/regex_internal.h | 19 -------------------
 1 file changed, 19 deletions(-)
  

Comments

Paul Eggert Jan. 9, 2021, 1:20 a.m. UTC | #1
This patch looks good for glibc, once the previous two regex patches are 
done. I installed it into Gnulib by applying the attached, so that 
regex_internal.h can stay in lock-step between Gnulib and glibc.
  
Adhemerval Zanella Jan. 11, 2021, 12:33 p.m. UTC | #2
On 08/01/2021 22:20, Paul Eggert wrote:
> This patch looks good for glibc, once the previous two regex patches are done. I installed it into Gnulib by applying the attached, so that regex_internal.h can stay in lock-step between Gnulib and glibc.

Right, I will sync the regex code with gnulib.  Thanks for checking
on this.
  

Patch

diff --git a/posix/regex_internal.h b/posix/regex_internal.h
index e31ac92674..641b27e2b1 100644
--- a/posix/regex_internal.h
+++ b/posix/regex_internal.h
@@ -444,25 +444,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