[Commit] nickle ChangeLog, 1.75, 1.76 configure.in, 1.36, 1.37 gram.y, 1.138, 1.139 hash.c, 1.7, 1.8 lex.l, 1.76, 1.77 main.c, 1.37, 1.38

Keith Packard commit at keithp.com
Wed Jul 28 17:23:35 PDT 2004


Committed by: keithp

Update of /local/src/CVS/nickle
In directory home.keithp.com:/tmp/cvs-serv4806

Modified Files:
	ChangeLog configure.in gram.y hash.c lex.l main.c 
Log Message:
2004-07-28  Keith Packard  <keithp at keithp.com>

	* configure.in:
	* main.c: (main):
	Unlimit stack so that GC can recurse forever
	
	* examples/Makefile.am:
	* examples/mutextest.5c:
	* examples/skiplist.5c:
	* examples/skiplisttest.5c:
	Add skiplists
	
	* gram.y:
	Fix precedence of ** so that ++x**2 works
	
	* hash.c: (HashEqual):
	Make sure hash element in table is valid before comparing

	* lex.l:
	Track newlines in files better.

	* test/orderofoptest.5c:
	Add comments about x value for each test.


Index: ChangeLog
===================================================================
RCS file: /local/src/CVS/nickle/ChangeLog,v
retrieving revision 1.75
retrieving revision 1.76
diff -u -d -r1.75 -r1.76
--- ChangeLog	22 Jul 2004 19:42:06 -0000	1.75
+++ ChangeLog	29 Jul 2004 00:23:31 -0000	1.76
@@ -1,3 +1,27 @@
+2004-07-28  Keith Packard  <keithp at keithp.com>
+
+	* configure.in:
+	* main.c: (main):
+	Unlimit stack so that GC can recurse forever
+	
+	* examples/Makefile.am:
+	* examples/mutextest.5c:
+	* examples/skiplist.5c:
+	* examples/skiplisttest.5c:
+	Add skiplists
+	
+	* gram.y:
+	Fix precedence of ** so that ++x**2 works
+	
+	* hash.c: (HashEqual):
+	Make sure hash element in table is valid before comparing
+
+	* lex.l:
+	Track newlines in files better.
+
+	* test/orderofoptest.5c:
+	Add comments about x value for each test.
+
 2004-07-22  Bart Massey  <bart at cs.pdx.edu>
 
 	* value.h:

Index: configure.in
===================================================================
RCS file: /local/src/CVS/nickle/configure.in,v
retrieving revision 1.36
retrieving revision 1.37
diff -u -d -r1.36 -r1.37
--- configure.in	28 May 2004 06:41:34 -0000	1.36
+++ configure.in	29 Jul 2004 00:23:32 -0000	1.37
@@ -35,7 +35,7 @@
 
 dnl Checks for header files.
 AC_HEADER_STDC
-AC_CHECK_HEADERS(fcntl.h strings.h time.h sys/time.h unistd.h)
+AC_CHECK_HEADERS(fcntl.h strings.h time.h sys/time.h unistd.h sys/resource.h)
 AC_CHECK_HEADERS(stropts.h)
 
 dnl Checks for typedefs, structures, and compiler characteristics.
@@ -66,7 +66,8 @@
 dnl Checks for library functions.
 AC_TYPE_SIGNAL
 AC_FUNC_VPRINTF
-AC_CHECK_FUNCS(unsetenv setenv putenv gettimeofday hstrerror select sigaction sigrelse sigignore)
+AC_CHECK_FUNCS(unsetenv setenv putenv gettimeofday hstrerror select)
+AC_CHECK_FUNCS(sigaction sigrelse sigignore setrlimit getrlimit)
 
 AC_FUNC_GETPGRP
 

Index: gram.y
===================================================================
RCS file: /local/src/CVS/nickle/gram.y,v
retrieving revision 1.138
retrieving revision 1.139
diff -u -d -r1.138 -r1.139
--- gram.y	7 Jul 2004 07:32:47 -0000	1.138
+++ gram.y	29 Jul 2004 00:23:32 -0000	1.139
@@ -188,9 +188,9 @@
 %left		SHIFTL SHIFTR
 %left		PLUS MINUS
 %left		TIMES DIVIDE DIV MOD
-%right		POW
+%right		POW STARSTAR
 %left		UNIONCAST
-%right		UMINUS BANG FACT LNOT INC DEC STAR STARSTAR AMPER THREADID
+%right		UMINUS BANG FACT LNOT INC DEC STAR AMPER THREADID
 %left		OS CS DOT ARROW STAROS CALL OP CP
 %right		POINTER
 %right		COLONCOLON

Index: hash.c
===================================================================
RCS file: /local/src/CVS/nickle/hash.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- hash.c	16 Apr 2004 05:26:45 -0000	1.7
+++ hash.c	29 Jul 2004 00:23:32 -0000	1.8
@@ -163,7 +163,7 @@
 	if (HashEltValid (ae)) 
 	{
 	    be = Find (bt, HashEltHash(ae), HashEltKey (ae));
-	    if (!be)
+	    if (!be || !HashEltValid (be))
 		return FalseVal;
 	    if (Equal (HashEltValue (be), HashEltValue (ae)) != TrueVal)
 		return FalseVal;

Index: lex.l
===================================================================
RCS file: /local/src/CVS/nickle/lex.l,v
retrieving revision 1.76
retrieving revision 1.77
diff -u -d -r1.76 -r1.77
--- lex.l	17 Jun 2004 20:30:47 -0000	1.76
+++ lex.l	29 Jul 2004 00:23:32 -0000	1.77
@@ -243,7 +243,6 @@
     int	    c;
     int	    result = 0;
     
-    if (lexInput->at_bol) { lexInput->lineno++; }
     while (result < max_size) {
 	if (lexInput->at_eof)
 	{
@@ -254,6 +253,7 @@
 	    c = LexGetInteractiveChar ();
 	else
 	    c = LexGetChar ();
+	if (lexInput->at_bol) { lexInput->lineno++; }
 	lexInput->at_bol = False;
 	if (c < 0) 
 	    break;

Index: main.c
===================================================================
RCS file: /local/src/CVS/nickle/main.c,v
retrieving revision 1.37
retrieving revision 1.38
diff -u -d -r1.37 -r1.38
--- main.c	16 Apr 2004 05:26:45 -0000	1.37
+++ main.c	29 Jul 2004 00:23:32 -0000	1.38
@@ -12,13 +12,18 @@
  *	main routine for nick
  */
 
+#include	"nickle.h"
+#include	"gram.h"
+
 #include	<setjmp.h>
 #define __USE_UNIX98 /* Get sigignore() and sigrelse()
 			prototype for Linux */
 #include	<signal.h>
 #include	<stdio.h>
-#include	"nickle.h"
-#include	"gram.h"
+
+#if HAVE_SYS_RESOURCE_H
+#include	<sys/resource.h>
+#endif
 
 int	stdin_interactive;
 
@@ -65,6 +70,20 @@
 int
 main (int argc, char **argv)
 {
+#if HAVE_GETRLIMIT && HAVE_SETRLIMIT
+    /*
+     * Allow stack to grow as large as possible to avoid
+     * crashes during recursive datastructure marking in the
+     * garbage collector
+     */
+    struct rlimit   lim;
+
+    if (getrlimit (RLIMIT_STACK, &lim) == 0)
+    {
+	lim.rlim_cur = lim.rlim_max;
+	(void) setrlimit (RLIMIT_STACK, &lim);
+    }
+#endif
     (void) catchSignal (SIGHUP, die);
     (void) catchSignal (SIGINT, intr);
     (void) catchSignal (SIGQUIT, die);




More information about the Commit mailing list