/[emacs]/emacs/src/alloc.c
ViewVC logotype

Diff of /emacs/src/alloc.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.319 by schwab, Fri Aug 8 23:14:04 2003 UTC revision 1.320 by gerd, Tue Aug 19 12:58:06 2003 UTC
# Line 766  lisp_align_malloc (nbytes, type) Line 766  lisp_align_malloc (nbytes, type)
766        mallopt (M_MMAP_MAX, MMAP_MAX_AREAS);        mallopt (M_MMAP_MAX, MMAP_MAX_AREAS);
767  #endif  #endif
768    
769          /* If the memory just allocated cannot be addressed thru a Lisp
770             object's pointer, and it needs to be, that's equivalent to
771             running out of memory.  */
772          if (type != MEM_TYPE_NON_LISP)
773            {
774              Lisp_Object tem;
775              char *end = (char *) base + ABLOCKS_BYTES - 1;
776              XSETCONS (tem, end);
777              if ((char *) XCONS (tem) != end)
778                {
779                  lisp_malloc_loser = base;
780                  free (base);
781                  UNBLOCK_INPUT;
782                  memory_full ();
783                }
784            }
785    
786        /* Initialize the blocks and put them on the free list.        /* Initialize the blocks and put them on the free list.
787           Is `base' was not properly aligned, we can't use the last block.  */           Is `base' was not properly aligned, we can't use the last block.  */
788        for (i = 0; i < (aligned ? ABLOCKS_SIZE : ABLOCKS_SIZE - 1); i++)        for (i = 0; i < (aligned ? ABLOCKS_SIZE : ABLOCKS_SIZE - 1); i++)
# Line 788  lisp_align_malloc (nbytes, type) Line 805  lisp_align_malloc (nbytes, type)
805    val = free_ablock;    val = free_ablock;
806    free_ablock = free_ablock->x.next_free;    free_ablock = free_ablock->x.next_free;
807    
   /* 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;  
         }  
     }  
   
808  #if GC_MARK_STACK && !defined GC_MALLOC_CHECK  #if GC_MARK_STACK && !defined GC_MALLOC_CHECK
809    if (val && type != MEM_TYPE_NON_LISP)    if (val && type != MEM_TYPE_NON_LISP)
810      mem_insert (val, (char *) val + nbytes, type);      mem_insert (val, (char *) val + nbytes, type);

Legend:
Removed from v.1.319  
changed lines
  Added in v.1.320

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26