diff src/alloc.c @ 104:cf808b4c4290 r20-1b4

Import from CVS: tag r20-1b4
author cvs
date Mon, 13 Aug 2007 09:16:51 +0200
parents a145efe76779
children 360340f9fd5f
line wrap: on
line diff
--- a/src/alloc.c	Mon Aug 13 09:15:51 2007 +0200
+++ b/src/alloc.c	Mon Aug 13 09:16:51 2007 +0200
@@ -217,7 +217,9 @@
     }
   else if (pureptr + size > PURESIZE)
     {
-      message ("\nERROR:  Pure Lisp storage exhausted!\n");
+      /* This can cause recursive bad behavior, we'll yell at the end */
+      /* when we're done. */
+      /* message ("\nERROR:  Pure Lisp storage exhausted!\n"); */
       pure_lossage = size;
       return (0);
     }
@@ -2574,12 +2576,14 @@
           {
             struct Lisp_Compiled_Function *o = XCOMPILED_FUNCTION (obj);
             Lisp_Object new = make_compiled_function (1);
-            struct Lisp_Compiled_Function *n = XCOMPILED_FUNCTION (obj);
+	    /* How on earth could this code have worked before?  -sb */
+            struct Lisp_Compiled_Function *n = XCOMPILED_FUNCTION (new);
             n->flags = o->flags;
             n->bytecodes = Fpurecopy (o->bytecodes);
             n->constants = Fpurecopy (o->constants);
             n->arglist = Fpurecopy (o->arglist);
             n->doc_and_interactive = Fpurecopy (o->doc_and_interactive);
+	    n->maxdepth = o->maxdepth;
             return (new);
           }
 #ifdef LISP_FLOAT_TYPE
@@ -2599,18 +2603,19 @@
 PURESIZE_h(long int puresize)
 {
   int fd;
-  char *PURESIZE_h_file = "PURESIZE.h";
+  char *PURESIZE_h_file = "puresize_adjust.h";
   char *WARNING = "/* This file is generated by XEmacs, DO NOT MODIFY!!! */\n";
   char define_PURESIZE[256];
 
-  if ((fd = open(PURESIZE_h_file, O_WRONLY|O_CREAT)) < 0) {
-    report_file_error("Can't write PURESIZE",
+  if ((fd = open(PURESIZE_h_file, O_WRONLY|O_CREAT|O_TRUNC, 0666)) < 0) {
+    report_file_error("Can't write PURESIZE_ADJUSTMENT",
 		      Fcons(build_ext_string(PURESIZE_h_file, FORMAT_FILENAME),
 			    Qnil));
   }
 
   write(fd, WARNING, strlen(WARNING));
-  sprintf(define_PURESIZE, "# define PURESIZE %ld\n", puresize);
+  sprintf(define_PURESIZE, "# define PURESIZE_ADJUSTMENT %ld\n",
+	  puresize - RAW_PURESIZE);
   write(fd, define_PURESIZE, strlen(define_PURESIZE));
   close(fd);
 }
@@ -2735,10 +2740,11 @@
   clear_message ();
 
   if (rc < 0) {
-    fatal ("Pure size adjusted, please type `make' again");
+    fatal ("Pure size adjusted, will restart `make'");
   } else if (pure_lossage && die_if_pure_storage_exceeded) {
     fatal ("Pure storage exhausted");
   }
+  (void)sys_unlink("SATISFIED");
 }
 
 
@@ -4224,6 +4230,11 @@
   Lisp_Object ret[6];
   int i;
 
+  if (purify_flag && pure_lossage)
+    {
+      return Qnil;
+    }
+
   garbage_collect_1 ();
 
   for (i = 0; i < last_lrecord_type_index_assigned; i++)