version 1.12, 2009/10/27 23:59:38 |
version 1.13, 2015/08/20 22:32:41 |
|
|
arcp -> arc_count += count; |
arcp -> arc_count += count; |
return; |
return; |
} |
} |
arcp = (arctype *)calloc( 1 , sizeof *arcp ); |
arcp = calloc( 1 , sizeof *arcp ); |
arcp -> arc_parentp = parentp; |
arcp -> arc_parentp = parentp; |
arcp -> arc_childp = childp; |
arcp -> arc_childp = childp; |
arcp -> arc_count = count; |
arcp -> arc_count = count; |
|
|
/* |
/* |
* Sort the symbol table in reverse topological order |
* Sort the symbol table in reverse topological order |
*/ |
*/ |
topsortnlp = (nltype **) calloc( nname , sizeof(nltype *) ); |
topsortnlp = calloc( nname , sizeof(nltype *) ); |
if ( topsortnlp == (nltype **) 0 ) |
if ( topsortnlp == (nltype **) 0 ) |
warnx("[doarcs] ran out of memory for topo sorting"); |
warnx("[doarcs] ran out of memory for topo sorting"); |
for ( index = 0 ; index < nname ; index += 1 ) { |
for ( index = 0 ; index < nname ; index += 1 ) { |
|
|
* sorting both the regular function names |
* sorting both the regular function names |
* and cycle headers. |
* and cycle headers. |
*/ |
*/ |
timesortnlp = (nltype **) calloc( nname + ncycle , sizeof(nltype *) ); |
timesortnlp = calloc( nname + ncycle , sizeof(nltype *) ); |
if ( timesortnlp == (nltype **) 0 ) |
if ( timesortnlp == (nltype **) 0 ) |
warnx("ran out of memory for sorting"); |
warnx("ran out of memory for sorting"); |
for ( index = 0 ; index < nname ; index++ ) { |
for ( index = 0 ; index < nname ; index++ ) { |
|
|
* cyclenl is indexed by cycle number: |
* cyclenl is indexed by cycle number: |
* i.e. it is origin 1, not origin 0. |
* i.e. it is origin 1, not origin 0. |
*/ |
*/ |
cyclenl = (nltype *) calloc( ncycle + 1 , sizeof( nltype ) ); |
cyclenl = calloc( ncycle + 1 , sizeof( nltype ) ); |
if ( cyclenl == 0 ) |
if ( cyclenl == 0 ) |
errx(0, "No room for %ld bytes of cycle headers", |
errx(0, "No room for %ld bytes of cycle headers", |
(ncycle + 1) * sizeof(nltype)); |
(ncycle + 1) * sizeof(nltype)); |
|
|
if ( size <= cyclethreshold ) |
if ( size <= cyclethreshold ) |
continue; |
continue; |
done = FALSE; |
done = FALSE; |
cyclestack = (arctype **) calloc( size + 1 , sizeof( arctype *) ); |
cyclestack = calloc( size + 1 , sizeof( arctype *) ); |
if ( cyclestack == 0 ) { |
if ( cyclestack == 0 ) { |
warnx("No room for %ld bytes of cycle stack" , |
warnx("No room for %ld bytes of cycle stack" , |
(size + 1) * sizeof(arctype *)); |
(size + 1) * sizeof(arctype *)); |
|
|
return( TRUE ); |
return( TRUE ); |
} |
} |
} |
} |
clp = (cltype *) |
clp = calloc( 1 , sizeof ( cltype ) + ( size - 1 ) * sizeof( arctype * ) ); |
calloc( 1 , sizeof ( cltype ) + ( size - 1 ) * sizeof( arctype * ) ); |
|
if ( clp == 0 ) { |
if ( clp == 0 ) { |
warnx("No room for %ld bytes of subcycle storage" , |
warnx("No room for %ld bytes of subcycle storage" , |
sizeof(cltype) + (size - 1) * sizeof(arctype *)); |
sizeof(cltype) + (size - 1) * sizeof(arctype *)); |