Changes in / [6a036eb:ea3fa25]
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/concurrency/clib/cfathread.cfa
r6a036eb rea3fa25 59 59 void cfathread_setproccnt( int ncnt ) { 60 60 assert( ncnt >= 1 ); 61 adelete( proc_cnt, procs);61 adelete( procs ); 62 62 63 63 proc_cnt = ncnt - 1; -
libcfa/src/stdlib.cfa
r6a036eb rea3fa25 58 58 59 59 forall( dtype T | sized(T) | { void ^?{}( T & ); } ) 60 void adelete( size_t dim,T arr[] ) {60 void adelete( T arr[] ) { 61 61 if ( arr ) { // ignore null 62 size_t dim = malloc_size( arr ) / sizeof( T ); 62 63 for ( int i = dim - 1; i >= 0; i -= 1 ) { // reverse allocation order, must be unsigned 63 64 ^(arr[i]){}; // run destructor … … 68 69 69 70 forall( dtype T | sized(T) | { void ^?{}( T & ); }, ttype Params | { void adelete( Params ); } ) 70 void adelete( size_t dim,T arr[], Params rest ) {71 void adelete( T arr[], Params rest ) { 71 72 if ( arr ) { // ignore null 73 size_t dim = malloc_size( arr ) / sizeof( T ); 72 74 for ( int i = dim - 1; i >= 0; i -= 1 ) { // reverse allocation order, must be unsigned 73 75 ^(arr[i]){}; // run destructor -
libcfa/src/stdlib.hfa
r6a036eb rea3fa25 263 263 // Cforall allocation/deallocation and constructor/destructor, array types 264 264 forall( 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 );265 forall( dtype T | sized(T) | { void ^?{}( T & ); } ) void adelete( T arr[] ); 266 forall( dtype T | sized(T) | { void ^?{}( T & ); }, ttype Params | { void adelete( Params ); } ) void adelete( T arr[], Params rest ); 267 267 268 268 //--------------------------------------- -
tests/alloc.cfa
r6a036eb rea3fa25 342 342 for ( i; dim ) { printf( "%d %g, ", stp1[i].x, stp1[i].y ); } 343 343 printf( "\n" ); 344 adelete( dim, stp, dim, stp1 );344 adelete( stp, stp1 ); 345 345 346 346 // extras
Note:
See TracChangeset
for help on using the changeset viewer.