emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/src/alloc.c


From: Gerd Moellmann
Subject: [Emacs-diffs] Changes to emacs/src/alloc.c
Date: Tue, 19 Aug 2003 08:58:08 -0400

Index: emacs/src/alloc.c
diff -c emacs/src/alloc.c:1.319 emacs/src/alloc.c:1.320
*** emacs/src/alloc.c:1.319     Fri Aug  8 19:14:04 2003
--- emacs/src/alloc.c   Tue Aug 19 08:58:06 2003
***************
*** 766,771 ****
--- 766,788 ----
        mallopt (M_MMAP_MAX, MMAP_MAX_AREAS);
  #endif
  
+       /* If the memory just allocated cannot be addressed thru a Lisp
+        object's pointer, and it needs to be, that's equivalent to
+        running out of memory.  */
+       if (type != MEM_TYPE_NON_LISP)
+       {
+         Lisp_Object tem;
+         char *end = (char *) base + ABLOCKS_BYTES - 1;
+         XSETCONS (tem, end);
+         if ((char *) XCONS (tem) != end)
+           {
+             lisp_malloc_loser = base;
+             free (base);
+             UNBLOCK_INPUT;
+             memory_full ();
+           }
+       }
+ 
        /* Initialize the blocks and put them on the free list.
         Is `base' was not properly aligned, we can't use the last block.  */
        for (i = 0; i < (aligned ? ABLOCKS_SIZE : ABLOCKS_SIZE - 1); i++)
***************
*** 787,807 ****
    ABLOCKS_BUSY (abase) = (struct ablocks *) (2 + (int) ABLOCKS_BUSY (abase));
    val = free_ablock;
    free_ablock = free_ablock->x.next_free;
- 
-   /* If the memory just allocated cannot be addressed thru a Lisp
-      object's pointer, and it needs to be,
-      that's equivalent to running out of memory.  */
-   if (val && type != MEM_TYPE_NON_LISP)
-     {
-       Lisp_Object tem;
-       XSETCONS (tem, (char *) val + nbytes - 1);
-       if ((char *) XCONS (tem) != (char *) val + nbytes - 1)
-       {
-         lisp_malloc_loser = val;
-         free (val);
-         val = 0;
-       }
-     }
  
  #if GC_MARK_STACK && !defined GC_MALLOC_CHECK
    if (val && type != MEM_TYPE_NON_LISP)
--- 804,809 ----




reply via email to

[Prev in Thread] Current Thread [Next in Thread]