/[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.322 by miles, Mon Sep 1 15:45:51 2003 UTC revision 1.323 by schwab, Sun Sep 7 19:15:32 2003 UTC
# Line 711  struct ablocks Line 711  struct ablocks
711  #define ABLOCKS_BASE(abase) (abase)  #define ABLOCKS_BASE(abase) (abase)
712  #else  #else
713  #define ABLOCKS_BASE(abase) \  #define ABLOCKS_BASE(abase) \
714    (1 & (int) ABLOCKS_BUSY (abase) ? abase : ((void**)abase)[-1])    (1 & (long) ABLOCKS_BUSY (abase) ? abase : ((void**)abase)[-1])
715  #endif  #endif
716    
717  /* The list of free ablock.   */  /* The list of free ablock.   */
# Line 792  lisp_align_malloc (nbytes, type) Line 792  lisp_align_malloc (nbytes, type)
792            abase->blocks[i].x.next_free = free_ablock;            abase->blocks[i].x.next_free = free_ablock;
793            free_ablock = &abase->blocks[i];            free_ablock = &abase->blocks[i];
794          }          }
795        ABLOCKS_BUSY (abase) = (struct ablocks *) aligned;        ABLOCKS_BUSY (abase) = (struct ablocks *) (long) aligned;
796    
797        eassert (0 == ((EMACS_UINT)abase) % BLOCK_ALIGN);        eassert (0 == ((EMACS_UINT)abase) % BLOCK_ALIGN);
798        eassert (ABLOCK_ABASE (&abase->blocks[3]) == abase); /* 3 is arbitrary */        eassert (ABLOCK_ABASE (&abase->blocks[3]) == abase); /* 3 is arbitrary */
799        eassert (ABLOCK_ABASE (&abase->blocks[0]) == abase);        eassert (ABLOCK_ABASE (&abase->blocks[0]) == abase);
800        eassert (ABLOCKS_BASE (abase) == base);        eassert (ABLOCKS_BASE (abase) == base);
801        eassert (aligned == (int)ABLOCKS_BUSY (abase));        eassert (aligned == (long) ABLOCKS_BUSY (abase));
802      }      }
803    
804    abase = ABLOCK_ABASE (free_ablock);    abase = ABLOCK_ABASE (free_ablock);
805    ABLOCKS_BUSY (abase) = (struct ablocks *) (2 + (int) ABLOCKS_BUSY (abase));    ABLOCKS_BUSY (abase) = (struct ablocks *) (2 + (long) ABLOCKS_BUSY (abase));
806    val = free_ablock;    val = free_ablock;
807    free_ablock = free_ablock->x.next_free;    free_ablock = free_ablock->x.next_free;
808    
# Line 834  lisp_align_free (block) Line 834  lisp_align_free (block)
834    ablock->x.next_free = free_ablock;    ablock->x.next_free = free_ablock;
835    free_ablock = ablock;    free_ablock = ablock;
836    /* Update busy count.  */    /* Update busy count.  */
837    ABLOCKS_BUSY (abase) = (struct ablocks *) (-2 + (int) ABLOCKS_BUSY (abase));    ABLOCKS_BUSY (abase) = (struct ablocks *) (-2 + (long) ABLOCKS_BUSY (abase));
838        
839    if (2 > (int) ABLOCKS_BUSY (abase))    if (2 > (long) ABLOCKS_BUSY (abase))
840      { /* All the blocks are free.  */      { /* All the blocks are free.  */
841        int i = 0, aligned = (int) ABLOCKS_BUSY (abase);        int i = 0, aligned = (long) ABLOCKS_BUSY (abase);
842        struct ablock **tem = &free_ablock;        struct ablock **tem = &free_ablock;
843        struct ablock *atop = &abase->blocks[aligned ? ABLOCKS_SIZE : ABLOCKS_SIZE - 1];        struct ablock *atop = &abase->blocks[aligned ? ABLOCKS_SIZE : ABLOCKS_SIZE - 1];
844    

Legend:
Removed from v.1.322  
changed lines
  Added in v.1.323

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