Changeset 83408


Ignore:
Timestamp:
Mar 11, 2013, 5:23:07 PM (6 years ago)
Author:
Steven Watanabe
Message:

Prevent incorrect reordering with xlc -qalias=ansi. Fixes #7093.

Location:
trunk/tools/build/v2/engine
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/build/v2/engine/lists.c

    r80180 r83408  
    1414#include <assert.h>
    1515
    16 
    17 struct freelist_node { struct freelist_node * next; };
    18 
    19 static struct freelist_node * freelist[ 32 ];  /* junkpile for list_dealloc() */
     16static LIST * freelist[ 32 ];  /* junkpile for list_dealloc() */
    2017
    2118static unsigned get_bucket( unsigned size )
     
    3128    if ( freelist[ bucket ] )
    3229    {
    33         struct freelist_node * result = freelist[ bucket ];
    34         freelist[ bucket ] = result->next;
    35         return (LIST *)result;
     30        LIST * result = freelist[ bucket ];
     31        freelist[ bucket ] = result->impl.next;
     32        return result;
    3633    }
    3734    return (LIST *)BJAM_MALLOC( sizeof( LIST ) + ( 1u << bucket ) *
     
    4340    unsigned size = list_length( l );
    4441    unsigned bucket;
    45     struct freelist_node * node = (struct freelist_node *)l;
     42    LIST * node = l;
    4643
    4744    if ( size == 0 ) return;
     
    5249    BJAM_FREE( node );
    5350#else
    54     node->next = freelist[ bucket ];
     51    node->impl.next = freelist[ bucket ];
    5552    freelist[ bucket ] = node;
    5653#endif
     
    373370    for ( i = 0; i < sizeof( freelist ) / sizeof( freelist[ 0 ] ); ++i )
    374371    {
    375         struct freelist_node * l = freelist[ i ];
     372        LIST * l = freelist[ i ];
    376373        while ( l )
    377374        {
    378             struct freelist_node * const tmp = l;
    379             l = l->next;
     375            LIST * const tmp = l;
     376            l = l->impl.next;
    380377            BJAM_FREE( tmp );
    381378        }
  • trunk/tools/build/v2/engine/lists.h

    r80063 r83408  
    5555    union {
    5656        int size;
     57        struct _list * next;
    5758        OBJECT * align;
    5859    } impl;
Note: See TracChangeset for help on using the changeset viewer.