[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug-gnulib] getdate rewrite to avoid alloca entirely
From: |
Paul Eggert |
Subject: |
[bug-gnulib] getdate rewrite to avoid alloca entirely |
Date: |
Thu, 23 Dec 2004 22:15:49 -0800 |
User-agent: |
Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3 (gnu/linux) |
I installed this, in both gnulib and coreutils:
2004-12-23 Paul Eggert <address@hidden>
* lib/getdate.y (YYSTACK_USE_ALLOCA): Define to 0, since there's no
need to extend the stack.
(YYINITDEPTH): New macro, so that the initial stack isn't overly
large.
* m4/getdate.m4 (gl_GETDATE): Remove AC_FUNC_ALLOCA.
* modules/getdate (Depends-on): Remove alloca-opt.
Index: lib/getdate.y
===================================================================
RCS file: /cvsroot/gnulib/gnulib/lib/getdate.y,v
retrieving revision 1.93
retrieving revision 1.95
diff -p -u -r1.93 -r1.95
--- lib/getdate.y 20 Dec 2004 08:08:51 -0000 1.93
+++ lib/getdate.y 24 Dec 2004 05:29:20 -0000 1.95
@@ -36,18 +36,16 @@
#include "getdate.h"
-/* Use alloca only if it is known to be builtin. */
-#if HAVE_ALLOCA
-# include <alloca.h>
-#else
-# define YYSTACK_USE_ALLOCA 0
-#endif
+/* There's no need to extend the stack, so there's no need to involve
+ alloca. */
+#define YYSTACK_USE_ALLOCA 0
/* Tell Bison how much stack space is needed. 20 should be plenty for
this grammar, which is not right recursive. Beware setting it too
- high, since that might cause problems on machines whose alloca
+ high, since that might cause problems on machines whose
implementations have lame stack-overflow checking. */
#define YYMAXDEPTH 20
+#define YYINITDEPTH YYMAXDEPTH
/* Since the code of getdate.y is not included in the Emacs executable
itself, there is no need to #define static in this file. Even if
Index: m4/getdate.m4
===================================================================
RCS file: /cvsroot/gnulib/gnulib/m4/getdate.m4,v
retrieving revision 1.4
retrieving revision 1.5
diff -p -u -r1.4 -r1.5
--- m4/getdate.m4 18 Apr 2004 18:12:50 -0000 1.4
+++ m4/getdate.m4 24 Dec 2004 06:06:43 -0000 1.5
@@ -1,4 +1,4 @@
-# getdate.m4 serial 4
+# getdate.m4 serial 5
dnl Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
dnl This file is free software, distributed under the terms of the GNU
dnl General Public License. As a special exception to the GNU General
@@ -14,7 +14,6 @@ AC_DEFUN([gl_GETDATE],
dnl Prerequisites of lib/getdate.y.
AC_REQUIRE([gl_BISON])
- AC_REQUIRE([AC_FUNC_ALLOCA])
AC_REQUIRE([AC_HEADER_STDC])
AC_CHECK_FUNCS_ONCE(isascii)
AC_STRUCT_TIMEZONE
Index: modules/getdate
===================================================================
RCS file: /cvsroot/gnulib/gnulib/modules/getdate,v
retrieving revision 1.10
retrieving revision 1.11
diff -p -u -r1.10 -r1.11
--- modules/getdate 19 Dec 2004 13:45:27 -0000 1.10
+++ modules/getdate 24 Dec 2004 06:06:01 -0000 1.11
@@ -16,7 +16,6 @@ gettime
mktime
setenv
xalloc
-alloca-opt
configure.ac:
gl_GETDATE
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [bug-gnulib] getdate rewrite to avoid alloca entirely,
Paul Eggert <=