Changes in / [6a036eb:ea3fa25]


Ignore:
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • libcfa/src/concurrency/clib/cfathread.cfa

    r6a036eb rea3fa25  
    5959        void cfathread_setproccnt( int ncnt ) {
    6060                assert( ncnt >= 1 );
    61                 adelete(proc_cnt, procs);
     61                adelete( procs );
    6262
    6363                proc_cnt = ncnt - 1;
  • libcfa/src/stdlib.cfa

    r6a036eb rea3fa25  
    5858
    5959forall( dtype T | sized(T) | { void ^?{}( T & ); } )
    60 void adelete( size_t dim, T arr[] ) {
     60void adelete( T arr[] ) {
    6161        if ( arr ) {                                                                            // ignore null
     62                size_t dim = malloc_size( arr ) / sizeof( T );
    6263                for ( int i = dim - 1; i >= 0; i -= 1 ) {               // reverse allocation order, must be unsigned
    6364                        ^(arr[i]){};                                                            // run destructor
     
    6869
    6970forall( dtype T | sized(T) | { void ^?{}( T & ); }, ttype Params | { void adelete( Params ); } )
    70 void adelete( size_t dim, T arr[], Params rest ) {
     71void adelete( T arr[], Params rest ) {
    7172        if ( arr ) {                                                                            // ignore null
     73                size_t dim = malloc_size( arr ) / sizeof( T );
    7274                for ( int i = dim - 1; i >= 0; i -= 1 ) {               // reverse allocation order, must be unsigned
    7375                        ^(arr[i]){};                                                            // run destructor
  • libcfa/src/stdlib.hfa

    r6a036eb rea3fa25  
    263263// Cforall allocation/deallocation and constructor/destructor, array types
    264264forall( dtype T | sized(T), ttype Params | { void ?{}( T &, Params ); } ) T * anew( size_t dim, Params p );
    265 forall( dtype T | sized(T) | { void ^?{}( T & ); } ) void adelete( size_t dim, T arr[] );
    266 forall( dtype T | sized(T) | { void ^?{}( T & ); }, ttype Params | { void adelete( Params ); } ) void adelete( size_t dim, T arr[], Params rest );
     265forall( dtype T | sized(T) | { void ^?{}( T & ); } ) void adelete( T arr[] );
     266forall( dtype T | sized(T) | { void ^?{}( T & ); }, ttype Params | { void adelete( Params ); } ) void adelete( T arr[], Params rest );
    267267
    268268//---------------------------------------
  • tests/alloc.cfa

    r6a036eb rea3fa25  
    342342        for ( i; dim ) { printf( "%d %g, ", stp1[i].x, stp1[i].y ); }
    343343        printf( "\n" );
    344         adelete( dim, stp, dim, stp1 );
     344        adelete( stp, stp1 );
    345345
    346346        // extras
Note: See TracChangeset for help on using the changeset viewer.