Show
Ignore:
Timestamp:
08/13/08 13:49:09 (5 months ago)
Author:
odole
Message:

merge with webkit revision 35706

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/BAL/OWBAL/Concretizations/Memory/WK/BCArenaWK.cpp

    r243 r436  
    181181#endif 
    182182        a = (Arena*)fastMalloc(sz); 
    183         if (a)  { 
    184             a->limit = (uword)a + sz; 
    185             a->base = a->avail = (uword)ARENA_ALIGN(pool, a + 1); 
    186             rp = (char *)a->avail; 
    187             a->avail += nb; 
    188             /* the newly allocated arena is linked after pool->current  
    189             *  and becomes pool->current */ 
    190             a->next = pool->current->next; 
    191             pool->current->next = a; 
    192             pool->current = a; 
    193             if ( !pool->first.next ) 
    194                 pool->first.next = a; 
    195             return(rp); 
    196        } 
    197     } 
    198  
    199     /* we got to here, and there's no memory to allocate */ 
    200     return(0); 
     183        // fastMalloc will abort() if it fails, so we are guaranteed that a is not 0. 
     184        a->limit = (uword)a + sz; 
     185        a->base = a->avail = (uword)ARENA_ALIGN(pool, a + 1); 
     186        rp = (char *)a->avail; 
     187        a->avail += nb; 
     188        /* the newly allocated arena is linked after pool->current  
     189        *  and becomes pool->current */ 
     190        a->next = pool->current->next; 
     191        pool->current->next = a; 
     192        pool->current = a; 
     193        if ( !pool->first.next ) 
     194            pool->first.next = a; 
     195        return(rp); 
     196    } 
    201197} /* --- end ArenaAllocate() --- */ 
    202198