Changeset 1c507eb
- Timestamp:
- Sep 4, 2020, 2:00:53 PM (4 years ago)
- Branches:
- ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- 7a80113
- Parents:
- 5a1c9ef (diff), 2801829 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - Files:
-
- 5 added
- 17 edited
Legend:
- Unmodified
- Added
- Removed
-
doc/LaTeXmacros/common.tex
r5a1c9ef r1c507eb 11 11 %% Created On : Sat Apr 9 10:06:17 2016 12 12 %% Last Modified By : Peter A. Buhr 13 %% Last Modified On : Mon Jul 9 08:28:05 201814 %% Update Count : 38 013 %% Last Modified On : Fri Sep 4 13:56:52 2020 14 %% Update Count : 383 15 15 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 16 16 … … 36 36 % Names used in the document. 37 37 38 \usepackage{xspace} 38 39 \newcommand{\CFAIcon}{\textsf{C}\raisebox{\depth}{\rotatebox{180}{\textsf{A}}}\xspace} % Cforall symbolic name 39 40 \newcommand{\CFA}{\protect\CFAIcon} % safe for section/caption … … 241 242 }% 242 243 244 \usepackage{listings} % format program code 243 245 \usepackage{lstlang} 244 246 -
doc/man/cfa.1
r5a1c9ef r1c507eb 11 11 .\" Created On : Wed Jul 26 22:34:47 2017 12 12 .\" Last Modified By : Peter A. Buhr 13 .\" Last Modified On : Thu Jul 27 10:29:29 201714 .\" Update Count : 4413 .\" Last Modified On : Wed Sep 2 17:59:53 2020 14 .\" Update Count : 78 15 15 .\" 16 16 .\" nroff -man cfa.1 … … 23 23 .ds Cf "Cforall 24 24 .\" 25 .TH cfa 1 2017-07-27 cfa-\*(Mg25 .TH CFA 1 "2020-09-2" cfa-\*(Mg "\*(Cf Project" 26 26 .SH NAME 27 cfa \- \*(Cf Translator and Runtime Library27 cfa \- \*(Cf project translator and runtime library to enhance C 28 28 .SH SYNOPSIS 29 cfa [gcc-options] [C/\*(Cf source-files] [assembler/loader files] 29 cfa [cfa/gcc-options] 30 [cfa/c source-files] 31 [assembler/loader files] 30 32 .SH DESCRIPTION 33 \*(Cf (C-for-all) is an open-source project extending ISO C with modern safety and productivity features, while still ensuring backwards compatibility with C and its programmers. 34 31 35 The cfa command compiles C and \*(Cf source files and links C/\*(Cf object 32 36 files named on the command line. … … 34 38 The cfa command introduces a translator pass over the specified source files 35 39 after the C preprocessor but before the C compilation. The translator converts 36 new \*(Cf constructs into C statements. The cfa command also provides the 37 runtime library, which is linked with each \*(Cf application. 40 new \*(Cf constructs into C statements. The cfa command also provides a fully 41 concurrent (user-level threads) runtime library, which is linked with the 42 \*(Cf application. 38 43 39 44 The command line options depend on the particular C compiler used (gcc/clang 40 45 supported). As with most C compilers, the output is sent to the file a.out(5) 41 46 unless the -o option is present on the command line. See the reference pages 42 for gcc(1) for more information .47 for gcc(1) for more information on command line options. 43 48 .SH OPTIONS 44 49 When multiple conflicting options appear on the command line, e.g., … … 50 55 All of the options available to the gcc compiler are available to the cfa 51 56 translator. The following gcc flags are implicitly turned on: 52 .IP -std=gnu99 3 53 The 1999 C standard plus GNU extensions. 54 .IP -fgnu89-inline 55 Use the traditional GNU semantics for inline routines in C99 mode, which allows inline routines in header files. 57 .IP "-std=gnu11" 3 58 The 2011 C standard plus GNU extensions. 59 .IP "-fgnu89-inline" 60 Use the traditional GNU semantics for inline routines in C11 mode, which allows inline routines in header files. 61 .IP "-imacros stdbool.h" 62 Include stdbool.h to get defines for bool/true/false. 63 .IP "-latomic -lm" 64 Provide access to double-wide CAS instruction and math library. 56 65 .LP 57 66 The following additional options are available: 58 .IP -CFA367 .IP "-CFA" 3 59 68 Only the C preprocessor and the \*(Cf translator steps are performed and the transformed program is written to standard output, which makes it possible to examine the code generated by the \*(Cf translator. 60 69 The generated code starts with the standard \*(Cf prelude. 61 .IP -debug70 .IP "-debug" 62 71 The program is linked with the debugging version of the runtime system. 63 72 The debug version performs runtime checks to help during the debugging phase of a \*(Cf program, but can substantially slow program execution. 64 73 The runtime checks should only be removed after the program is completely debugged. 65 74 .B This option is the default. 66 .IP -nodebug75 .IP "-nodebug" 67 76 The program is linked with the non-debugging version of the runtime system, so the execution of the program is faster. 68 77 .I However, no runtime checks or asserts are performed so errors usually result in abnormal program behaviour or termination. 69 .IP -help78 .IP "-help" 70 79 Information about the set of \*(Cf compilation flags is printed. 71 .IP -nohelp80 .IP "-nohelp" 72 81 Information about the set of \*(Cf compilation flags is not printed. 73 82 .B This option is the default. 74 .IP -quiet83 .IP "-quiet" 75 84 The \*(Cf compilation message is not printed at the beginning of a compilation. 76 .IP -noquiet85 .IP "-noquiet" 77 86 The \*(Cf compilation message is printed at the beginning of a compilation. 78 87 .B This option is the default. … … 81 90 available. These variables allow conditional compilation of programs that must 82 91 work differently in these situations. 83 .IP __CFA_MAJOR__392 .IP "__CFA_MAJOR__" 3 84 93 is available during preprocessing and its value is the major version number of \*(Cf. 85 .IP __CFA_MINOR__94 .IP "__CFA_MINOR__" 86 95 is available during preprocessing and its value is the minor version number of \*(Cf. 87 .IP __CFA_PATCH__96 .IP "__CFA_PATCH__" 88 97 is available during preprocessing and its value is the patch level number of \*(Cf. 89 98 .IP "__CFA__, __CFORALL__, and __cforall" 90 99 are always available during preprocessing and have no value. 91 .IP __CFA_DEBUG__100 .IP "__CFA_DEBUG__" 92 101 is available during preprocessing if the -debug compilation option is 93 102 specified. … … 116 125 .SH REFERENCES 117 126 .HP 3 118 \*(Cf Reference and Rational Manual 127 .I \*(Cf Home Page 119 128 .br 120 http ://plg.uwaterloo.ca/~cforall/refrat.pdf129 https://cforall.uwaterloo.ca 121 130 .HP 122 131 .I \*(Cf User Manual 123 132 .br 124 http://plg.uwaterloo.ca/~cforall/user.pdf 133 https://cforall.uwaterloo.ca/doc/user.pdf 134 .SH BUILDS 135 Nightly builds are available here https://cforall.uwaterloo.ca/jenkins 125 136 .SH BUGS 126 Bugs should be reported to trac@plg.cs.uwaterloo.ca.137 Bugs reportss are available here https://cforall.uwaterloo.ca/trac 127 138 .SH COPYRIGHT 128 139 \*(Cf is covered under the licence agreement in the distribution. 129 140 .SH AUTHORS 130 141 Andrew Beach, Richard Bilson, Peter A. Buhr, Thierry Delisle, Glen Ditchfield, 131 Rodolfo G. Esteves, Aaron Moss, Rob Schluntz 142 Rodolfo G. Esteves, Aaron Moss, Rob Schluntz, Mubeen Zulfiqar -
driver/cfa.cc
r5a1c9ef r1c507eb 10 10 // Created On : Tue Aug 20 13:44:49 2002 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Thu Aug 20 23:43:59202013 // Update Count : 43 612 // Last Modified On : Wed Sep 2 17:59:20 2020 13 // Update Count : 438 14 14 // 15 15 … … 437 437 #endif // __x86_64__ 438 438 args[nargs++] = "-ldl"; 439 args[nargs++] = "-lrt";440 439 args[nargs++] = "-lm"; 441 440 } // if -
libcfa/src/bits/locks.hfa
r5a1c9ef r1c507eb 218 218 } 219 219 220 // Semaphore which only supports a single thread and one post 221 // Semaphore which only supports a single thread 220 // Synchronozation primitive which only supports a single thread and one post 221 // Similar to a binary semaphore with a 'one shot' semantic 222 // is expected to be discarded after each party call their side 222 223 struct oneshot { 224 // Internal state : 225 // 0p : is initial state (wait will block) 226 // 1p : fulfilled (wait won't block) 227 // any thread : a thread is currently waiting 223 228 struct $thread * volatile ptr; 224 229 }; … … 231 236 void ^?{}(oneshot & this) {} 232 237 238 // Wait for the post, return immidiately if it already happened. 239 // return true if the thread was parked 233 240 bool wait(oneshot & this) { 234 241 for() { … … 244 251 } 245 252 253 // Mark as fulfilled, wake thread if needed 254 // return true if a thread was unparked 246 255 bool post(oneshot & this) { 247 256 struct $thread * got = __atomic_exchange_n( &this.ptr, 1p, __ATOMIC_SEQ_CST); … … 251 260 } 252 261 } 262 263 // base types for future to build upon 264 // It is based on the 'oneshot' type to allow multiple futures 265 // to block on the same instance, permitting users to block a single 266 // thread on "any of" [a given set of] futures. 267 // does not support multiple threads waiting on the same future 268 struct future_t { 269 // Internal state : 270 // 0p : is initial state (wait will block) 271 // 1p : fulfilled (wait won't block) 272 // 2p : in progress () 273 // 3p : abandoned, server should delete 274 // any oneshot : a context has been setup to wait, a thread could wait on it 275 struct oneshot * volatile ptr; 276 }; 277 278 static inline { 279 void ?{}(future_t & this) { 280 this.ptr = 0p; 281 } 282 283 void ^?{}(future_t & this) {} 284 285 // check if the future is available 286 bool available( future_t & this ) { 287 return this.ptr == 1p; 288 } 289 290 // Prepare the future to be waited on 291 // intented to be use by wait, wait_any, waitfor, etc. rather than used directly 292 bool setup( future_t & this, oneshot & wait_ctx ) { 293 /* paranoid */ verify( wait_ctx.ptr == 0p ); 294 // The future needs to set the wait context 295 for() { 296 struct oneshot * expected = this.ptr; 297 // Is the future already fulfilled? 298 if(expected == 1p) return false; // Yes, just return false (didn't block) 299 300 // The future is not fulfilled, try to setup the wait context 301 /* paranoid */ verify( expected == 0p ); 302 if(__atomic_compare_exchange_n(&this.ptr, &expected, &wait_ctx, false, __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST)) { 303 return true; 304 } 305 } 306 } 307 308 // Stop waiting on a future 309 // When multiple futures are waited for together in "any of" pattern 310 // futures that weren't fulfilled before the thread woke up 311 // should retract the wait ctx 312 // intented to be use by wait, wait_any, waitfor, etc. rather than used directly 313 void retract( future_t & this, oneshot & wait_ctx ) { 314 // Remove the wait context 315 struct oneshot * got = __atomic_exchange_n( &this.ptr, 0p, __ATOMIC_SEQ_CST); 316 317 // got == 0p: future was never actually setup, just return 318 if( got == 0p ) return; 319 320 // got == wait_ctx: since fulfil does an atomic_swap, 321 // if we got back the original then no one else saw context 322 // It is safe to delete (which could happen after the return) 323 if( got == &wait_ctx ) return; 324 325 // got == 1p: the future is ready and the context was fully consumed 326 // the server won't use the pointer again 327 // It is safe to delete (which could happen after the return) 328 if( got == 1p ) return; 329 330 // got == 2p: the future is ready but the context hasn't fully been consumed 331 // spin until it is safe to move on 332 if( got == 2p ) { 333 while( this.ptr != 1p ) Pause(); 334 return; 335 } 336 337 // got == any thing else, something wen't wrong here, abort 338 abort("Future in unexpected state"); 339 } 340 341 // Mark the future as abandoned, meaning it will be deleted by the server 342 void abandon( future_t & this ) { 343 struct oneshot * got = __atomic_exchange_n( &this.ptr, 3p, __ATOMIC_SEQ_CST); 344 345 // got == 2p: the future is ready but the context hasn't fully been consumed 346 // spin until it is safe to move on 347 if( got == 2p ) { 348 while( this.ptr != 1p ) Pause(); 349 } 350 return; 351 } 352 353 // from the server side, mark the future as fulfilled 354 // delete it if needed 355 bool fulfil( future_t & this ) { 356 for() { 357 struct oneshot * expected = this.ptr; 358 // was this abandoned? 359 if( expected == 3p ) { free( &this ); return false; } 360 361 /* paranoid */ verify( expected != 1p ); // Future is already fulfilled, should not happen 362 /* paranoid */ verify( expected != 2p ); // Future is bein fulfilled by someone else, this is even less supported then the previous case. 363 364 // If there is a wait context, we need to consume it and mark it as consumed after 365 // If there is no context then we can skip the in progress phase 366 struct oneshot * want = expected == 0p ? 1p : 2p; 367 if(__atomic_compare_exchange_n(&this.ptr, &expected, want, false, __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST)) { 368 if( expected == 0p ) { /* paranoid */ verify( this.ptr == 1p); return false; } 369 bool ret = post( *expected ); 370 __atomic_store_n( &this.ptr, 1p, __ATOMIC_SEQ_CST); 371 return ret; 372 } 373 } 374 375 } 376 377 // Wait for the future to be fulfilled 378 bool wait( future_t & this ) { 379 oneshot temp; 380 if( !setup(this, temp) ) return false; 381 382 // Wait context is setup, just wait on it 383 bool ret = wait( temp ); 384 385 // Wait for the future to tru 386 while( this.ptr == 2p ) Pause(); 387 // Make sure the state makes sense 388 // Should be fulfilled, could be in progress but it's out of date if so 389 // since if that is the case, the oneshot was fulfilled (unparking this thread) 390 // and the oneshot should not be needed any more 391 __attribute__((unused)) struct oneshot * was = this.ptr; 392 /* paranoid */ verifyf( was == 1p, "Expected this.ptr to be 1p, was %p\n", was ); 393 394 // Mark the future as fulfilled, to be consistent 395 // with potential calls to avail 396 // this.ptr = 1p; 397 return ret; 398 } 399 } 253 400 #endif -
libcfa/src/heap.cfa
r5a1c9ef r1c507eb 10 10 // Created On : Tue Dec 19 21:58:35 2017 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Mon Aug 24 20:29:24 202013 // Update Count : 9 2612 // Last Modified On : Thu Sep 3 16:22:54 2020 13 // Update Count : 943 14 14 // 15 15 … … 29 29 #include "math.hfa" // ceiling 30 30 #include "bitmanip.hfa" // is_pow2, ceiling2 31 32 #define MIN(x, y) (y > x ? x : y)33 31 34 32 static bool traceHeap = false; … … 956 954 957 955 headers( "realloc", naddr, header, freeElem, bsize, oalign ); 958 memcpy( naddr, oaddr, MIN( osize, size ) ); // copy bytes956 memcpy( naddr, oaddr, min( osize, size ) ); // copy bytes 959 957 free( oaddr ); 960 958 … … 1218 1216 #endif // __STATISTICS__ 1219 1217 1220 // If size is equal to 0, either NULL or a pointer suitable to be passed to free() is returned.1221 if ( unlikely( size == 0 ) ) { free( oaddr ); return 0p; } // special cases1222 if ( unlikely( oaddr == 0p ) ) {1223 #ifdef __STATISTICS__1224 __atomic_add_fetch( &resize_storage, size, __ATOMIC_SEQ_CST );1225 #endif // __STATISTICS__1226 return memalignNoStats( nalign, size );1227 } // if1228 1229 1218 if ( unlikely( nalign < libAlign() ) ) nalign = libAlign(); // reset alignment to minimum 1230 1219 #ifdef __CFA_DEBUG__ … … 1233 1222 #endif // __CFA_DEBUG__ 1234 1223 1235 HeapManager.Storage.Header * header; 1236 HeapManager.FreeHeader * freeElem; 1237 size_t bsize, oalign; 1238 headers( "resize", oaddr, header, freeElem, bsize, oalign ); 1239 size_t odsize = dataStorage( bsize, oaddr, header ); // data storage available in bucket 1240 1241 if ( oalign <= nalign && (uintptr_t)oaddr % nalign == 0 ) { // <= alignment and new alignment happens to match 1242 if ( oalign > libAlign() ) { // fake header ? 1224 // If size is equal to 0, either NULL or a pointer suitable to be passed to free() is returned. 1225 if ( unlikely( size == 0 ) ) { free( oaddr ); return 0p; } // special cases 1226 if ( unlikely( oaddr == 0p ) ) { 1227 #ifdef __STATISTICS__ 1228 __atomic_add_fetch( &resize_storage, size, __ATOMIC_SEQ_CST ); 1229 #endif // __STATISTICS__ 1230 return memalignNoStats( nalign, size ); 1231 } // if 1232 1233 // Attempt to reuse existing storage. 1234 HeapManager.Storage.Header * header = headerAddr( oaddr ); 1235 if ( unlikely ( ( header->kind.fake.alignment & 1 == 1 && // old fake header ? 1236 (uintptr_t)oaddr % nalign == 0 && // lucky match ? 1237 header->kind.fake.alignment <= nalign && // ok to leave LSB at 1 1238 nalign <= 128 ) // not too much alignment storage wasted ? 1239 || ( header->kind.fake.alignment & 1 != 1 && // old real header ( aligned on libAlign ) ? 1240 nalign == libAlign() ) ) ) { // new alignment also on libAlign 1241 1242 HeapManager.FreeHeader * freeElem; 1243 size_t bsize, oalign; 1244 headers( "resize", oaddr, header, freeElem, bsize, oalign ); 1245 size_t odsize = dataStorage( bsize, oaddr, header ); // data storage available in bucket 1246 1247 if ( size <= odsize && odsize <= size * 2 ) { // allow 50% wasted data storage 1243 1248 headerAddr( oaddr )->kind.fake.alignment = nalign | 1; // update alignment (could be the same) 1244 } // if 1245 if ( size <= odsize && odsize <= size * 2 ) { // allow 50% wasted storage for smaller size 1246 header->kind.real.blockSize &= -2; // turn off 0 fill 1247 header->kind.real.size = size; // reset allocation size 1249 1250 header->kind.real.blockSize &= -2; // turn off 0 fill 1251 header->kind.real.size = size; // reset allocation size 1248 1252 return oaddr; 1249 1253 } // if … … 1267 1271 #endif // __CFA_DEBUG__ 1268 1272 1273 // If size is equal to 0, either NULL or a pointer suitable to be passed to free() is returned. 1274 if ( unlikely( size == 0 ) ) { free( oaddr ); return 0p; } // special cases 1275 if ( unlikely( oaddr == 0p ) ) { 1276 #ifdef __STATISTICS__ 1277 __atomic_add_fetch( &realloc_calls, 1, __ATOMIC_SEQ_CST ); 1278 __atomic_add_fetch( &realloc_storage, size, __ATOMIC_SEQ_CST ); 1279 #endif // __STATISTICS__ 1280 return memalignNoStats( nalign, size ); 1281 } // if 1282 1269 1283 HeapManager.Storage.Header * header; 1270 1284 HeapManager.FreeHeader * freeElem; … … 1272 1286 headers( "realloc", oaddr, header, freeElem, bsize, oalign ); 1273 1287 1274 if ( oalign <= nalign && (uintptr_t)oaddr % nalign == 0 ) { // <= alignment and new alignment happens to match 1275 if ( oalign > libAlign() ) { // fake header ? 1276 headerAddr( oaddr )->kind.fake.alignment = nalign | 1; // update alignment (could be the same) 1277 } // if 1288 // Attempt to reuse existing storage. 1289 if ( unlikely ( ( header->kind.fake.alignment & 1 == 1 && // old fake header ? 1290 (uintptr_t)oaddr % nalign == 0 && // lucky match ? 1291 header->kind.fake.alignment <= nalign && // ok to leave LSB at 1 1292 nalign <= 128 ) // not too much alignment storage wasted ? 1293 || ( header->kind.fake.alignment & 1 != 1 && // old real header ( aligned on libAlign ) ? 1294 nalign == libAlign() ) ) ) { // new alignment also on libAlign 1295 1296 headerAddr( oaddr )->kind.fake.alignment = nalign | 1; // update alignment (could be the same) 1278 1297 return realloc( oaddr, size ); 1298 1279 1299 } // if 1280 1300 … … 1286 1306 #endif // __STATISTICS__ 1287 1307 1288 // If size is equal to 0, either NULL or a pointer suitable to be passed to free() is returned.1289 if ( unlikely( size == 0 ) ) { free( oaddr ); return 0p; } // special cases1290 if ( unlikely( oaddr == 0p ) ) return memalignNoStats( nalign, size );1291 1292 1308 size_t osize = header->kind.real.size; // old allocation size 1293 1309 bool ozfill = (header->kind.real.blockSize & 2) != 0; // old allocation zero filled … … 1296 1312 1297 1313 headers( "realloc", naddr, header, freeElem, bsize, oalign ); 1298 memcpy( naddr, oaddr, MIN( osize, size ) ); // copy bytes1314 memcpy( naddr, oaddr, min( osize, size ) ); // copy bytes 1299 1315 free( oaddr ); 1300 1316 -
libcfa/src/stdlib.hfa
r5a1c9ef r1c507eb 10 10 // Created On : Thu Jan 28 17:12:35 2016 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Fri Aug 14 23:38:50202013 // Update Count : 50 412 // Last Modified On : Tue Sep 1 20:32:34 2020 13 // Update Count : 505 14 14 // 15 15 … … 44 44 45 45 // Macro because of returns 46 #define $VAR_ALLOC( allocation, alignment ) \47 if ( _Alignof(T) <= libAlign() ) return (T *)(void *)allocation( (size_t)sizeof(T) ); /* C allocation */ \48 else return (T *)alignment( _Alignof(T), sizeof(T) )49 50 46 #define $ARRAY_ALLOC( allocation, alignment, dim ) \ 51 47 if ( _Alignof(T) <= libAlign() ) return (T *)(void *)allocation( dim, (size_t)sizeof(T) ); /* C allocation */ \ 52 48 else return (T *)alignment( _Alignof(T), dim, sizeof(T) ) 53 49 54 #define $RE_SPECIALS( ptr, size, allocation, alignment ) \55 if ( unlikely( size == 0 ) || unlikely( ptr == 0p ) ) { \56 if ( unlikely( size == 0 ) ) free( ptr ); \57 $VAR_ALLOC( malloc, memalign ); \58 } /* if */59 60 50 static inline forall( dtype T | sized(T) ) { 61 51 // Cforall safe equivalents, i.e., implicit size specification 62 52 63 53 T * malloc( void ) { 64 $VAR_ALLOC( malloc, memalign ); 54 if ( _Alignof(T) <= libAlign() ) return (T *)(void *)malloc( (size_t)sizeof(T) ); // C allocation 55 else return (T *)memalign( _Alignof(T), sizeof(T) ); 65 56 } // malloc 66 57 … … 74 65 75 66 T * resize( T * ptr, size_t size ) { // CFA resize, eliminate return-type cast 76 $RE_SPECIALS( ptr, size, malloc, memalign );77 67 if ( _Alignof(T) <= libAlign() ) return (T *)(void *)resize( (void *)ptr, size ); // CFA resize 78 68 else return (T *)(void *)resize( (void *)ptr, _Alignof(T), size ); // CFA resize … … 80 70 81 71 T * realloc( T * ptr, size_t size ) { // CFA realloc, eliminate return-type cast 82 $RE_SPECIALS( ptr, size, malloc, memalign );83 72 if ( _Alignof(T) <= libAlign() ) return (T *)(void *)realloc( (void *)ptr, size ); // C realloc 84 73 else return (T *)(void *)realloc( (void *)ptr, _Alignof(T), size ); // CFA realloc … … 189 178 size_t copy_end = 0; 190 179 191 if (Resize) {192 ptr = (T*) (void *) resize( ( int*)Resize, Align, Dim * size );193 } else if ( Realloc) {180 if ( Resize ) { 181 ptr = (T*) (void *) resize( (void *)Resize, Align, Dim * size ); 182 } else if ( Realloc ) { 194 183 if (Fill.tag != '0') copy_end = min(malloc_size( Realloc ), Dim * size); 195 ptr = (T*) (void *) realloc( ( int*)Realloc, Align, Dim * size );184 ptr = (T*) (void *) realloc( (void *)Realloc, Align, Dim * size ); 196 185 } else { 197 186 ptr = (T*) (void *) memalign( Align, Dim * size ); -
src/AST/Pass.hpp
r5a1c9ef r1c507eb 48 48 // 49 49 // Several additional features are available through inheritance 50 // | PureVisitor - makes the visitor pure, it never modifies nodes in place and always 51 // clones nodes it needs to make changes to 50 52 // | WithTypeSubstitution - provides polymorphic const TypeSubstitution * env for the 51 53 // current expression … … 267 269 /// Keep track of the polymorphic const TypeSubstitution * env for the current expression 268 270 269 /// marker to force shallow copies in pass visit271 /// If used the visitor will always clone nodes. 270 272 struct PureVisitor {}; 271 273 -
src/AST/Pass.impl.hpp
r5a1c9ef r1c507eb 21 21 22 22 #include "AST/TypeSubstitution.hpp" 23 // #include "AST/Copy.hpp"24 23 25 24 #define VISIT_START( node ) \ … … 329 328 330 329 if( __pass::differs(old_val, new_val) ) { 331 // auto new_parent = mutate(parent);332 330 auto new_parent = __pass::mutate<core_t>(parent); 333 331 new_parent->*child = new_val; -
src/AST/TypeSubstitution.hpp
r5a1c9ef r1c507eb 46 46 template< typename SynTreeClass > 47 47 struct ApplyResult { 48 // const SynTreeClass * node;49 48 ast::ptr<SynTreeClass> node; 50 49 int count; … … 187 186 assert( input ); 188 187 Pass<Substituter> sub( *this, false ); 189 // input = strict_dynamic_cast< const SynTreeClass * >( deepCopy(input)->accept( sub ) );190 188 input = strict_dynamic_cast< const SynTreeClass * >( input->accept( sub ) ); 191 189 return { input, sub.core.subCount }; … … 196 194 assert( input ); 197 195 Pass<Substituter> sub( *this, true ); 198 // input = strict_dynamic_cast< const SynTreeClass * >( deepCopy(input)->accept( sub ) );199 196 input = strict_dynamic_cast< const SynTreeClass * >( input->accept( sub ) ); 200 197 return { input, sub.core.subCount }; -
src/ResolvExpr/Unify.cc
r5a1c9ef r1c507eb 1113 1113 ast::Pass<TtypeExpander_new> expander{ tenv }; 1114 1114 1115 // ast::ptr<ast::TupleType> tuplec = tuple;1116 // ast::ptr<ast::TupleType> tuple2c = tuple2;1117 1115 const ast::Type * flat = tuple->accept( expander ); 1118 1116 const ast::Type * flat2 = tuple2->accept( expander ); -
tests/.expect/alloc-ERROR.txt
r5a1c9ef r1c507eb 1 alloc.cfa:36 2:1 error: No reasonable alternatives for expression Applying untyped:1 alloc.cfa:361:1 error: No reasonable alternatives for expression Applying untyped: 2 2 Name: ?=? 3 3 ...to: … … 16 16 Name: stp 17 17 18 with resolved type:19 unsigned long int20 18 21 19 22 20 23 alloc.cfa:36 3:1 error: No reasonable alternatives for expression Applying untyped:21 alloc.cfa:362:1 error: No reasonable alternatives for expression Applying untyped: 24 22 Name: ?=? 25 23 ...to: … … 30 28 Name: stp 31 29 constant expression (10 10: signed int) 32 with resolved type:33 signed int34 30 35 31 36 alloc.cfa:36 4:1 error: No reasonable alternatives for expression Applying untyped:32 alloc.cfa:363:1 error: No reasonable alternatives for expression Applying untyped: 37 33 Name: ?=? 38 34 ...to: -
tests/.expect/alloc.txt
r5a1c9ef r1c507eb 14 14 0xdededede 0xdededede 0xdededede 0xdededede 0xdededede 0xdededede 0xdededede 0xdededede 0xdededede 0xdededede 0xdededede 0xdededede 0xdededede 0xdededede 0xdededede 0xdededede 0xdededede 0xdededede 0xdededede 0xdededede 15 15 CFA array alloc, fill 0xef 16 0x efefefef 0xefefefef 0xefefefef 0xefefefef 0xefefefef 0xefefefef 0xefefefef 0xefefefef 0xefefefef 0xefefefef 0xefefefef 0xefefefef 0xefefefef 0xefefefef 0xefefefef 0xefefefef 0xefefefef 0xefefefef 0xefefefef 0xefefefef16 0xdeadbeef 0xdeadbeef 0xdeadbeef 0xdeadbeef 0xdeadbeef 0xdeadbeef 0xdeadbeef 0xdeadbeef 0xdeadbeef 0xdeadbeef 0xdeadbeef 0xdeadbeef 0xdeadbeef 0xdeadbeef 0xdeadbeef 0xdeadbeef 0xdeadbeef 0xdeadbeef 0xdeadbeef 0xdeadbeef 17 17 CFA array alloc, fill from array 18 0x efefefef 0xefefefef, 0xefefefef 0xefefefef, 0xefefefef 0xefefefef, 0xefefefef 0xefefefef, 0xefefefef 0xefefefef, 0xefefefef 0xefefefef, 0xefefefef 0xefefefef, 0xefefefef 0xefefefef, 0xefefefef 0xefefefef, 0xefefefef 0xefefefef, 0xefefefef 0xefefefef, 0xefefefef 0xefefefef, 0xefefefef 0xefefefef, 0xefefefef 0xefefefef, 0xefefefef 0xefefefef, 0xefefefef 0xefefefef, 0xefefefef 0xefefefef, 0xefefefef 0xefefefef, 0xefefefef 0xefefefef, 0xefefefef 0xefefefef,18 0xdeadbeef 0xdeadbeef, 0xdeadbeef 0xdeadbeef, 0xdeadbeef 0xdeadbeef, 0xdeadbeef 0xdeadbeef, 0xdeadbeef 0xdeadbeef, 0xdeadbeef 0xdeadbeef, 0xdeadbeef 0xdeadbeef, 0xdeadbeef 0xdeadbeef, 0xdeadbeef 0xdeadbeef, 0xdeadbeef 0xdeadbeef, 0xdeadbeef 0xdeadbeef, 0xdeadbeef 0xdeadbeef, 0xdeadbeef 0xdeadbeef, 0xdeadbeef 0xdeadbeef, 0xdeadbeef 0xdeadbeef, 0xdeadbeef 0xdeadbeef, 0xdeadbeef 0xdeadbeef, 0xdeadbeef 0xdeadbeef, 0xdeadbeef 0xdeadbeef, 0xdeadbeef 0xdeadbeef, 19 19 20 20 C realloc 21 0x efefefef 0xefefefef 0xefefefef 0xefefefef 0xefefefef 0xefefefef 0xefefefef 0xefefefef 0xefefefef 0xefefefef21 0xdeadbeef 0xdeadbeef 0xdeadbeef 0xdeadbeef 0xdeadbeef 0xdeadbeef 0xdeadbeef 0xdeadbeef 0xdeadbeef 0xdeadbeef 22 22 CFA realloc 23 0x efefefef 0xefefefef 0xefefefef 0xefefefef 0xefefefef 0xefefefef 0xefefefef 0xefefefef 0xefefefef 0xefefefef 0x1010101 0x1010101 0x1010101 0x1010101 0x1010101 0x1010101 0x1010101 0x1010101 0x1010101 0x101010123 0xdeadbeef 0xdeadbeef 0xdeadbeef 0xdeadbeef 0xdeadbeef 0xdeadbeef 0xdeadbeef 0xdeadbeef 0xdeadbeef 0xdeadbeef 0x1010101 0x1010101 0x1010101 0x1010101 0x1010101 0x1010101 0x1010101 0x1010101 0x1010101 0x1010101 24 24 25 25 CFA realloc array alloc -
tests/alloc2.cfa
r5a1c9ef r1c507eb 1 /*2 some tests are commented-out because of resize/realloc bug from 0p. They should be uncommented after that bug is resolved.3 */4 5 1 #include <malloc.h> // malloc_usable_size 6 2 #include <stdint.h> // uintptr_t … … 20 16 if (!passed) { 21 17 printf("failed test %3d: %4lu %4lu but got %4lu ( %3lu ) %4lu\n", tests_total, size, align, malloc_size(ip), malloc_usable_size(ip), malloc_alignment(ip)); 22 // if (last_failed != tests_total) { 23 tests_failed += 1; 24 // last_failed = tests_total; 25 // } 18 tests_failed += 1; 26 19 } 27 20 } … … 34 27 if (!passed) { 35 28 printf("failed test %3d: fill C\n", tests_total); 36 // if (last_failed != tests_total) { 37 tests_failed += 1; 38 // last_failed = tests_total; 39 // } 29 tests_failed += 1; 40 30 } 41 31 } … … 48 38 if (!passed) { 49 39 printf("failed test %3d: fill int\n", tests_total); 50 // if (last_failed != tests_total) { 51 tests_failed += 1; 52 // last_failed = tests_total; 53 // } 40 tests_failed += 1; 54 41 } 55 42 } … … 60 47 if (!passed) { 61 48 printf("failed test %3d: fill int A\n", tests_total); 62 // if (last_failed != tests_total) { 63 tests_failed += 1; 64 // last_failed = tests_total; 65 // } 49 tests_failed += 1; 66 50 } 67 51 } … … 74 58 if (!passed) { 75 59 printf("failed test %3d: fill T1\n", tests_total); 76 // if (last_failed != tests_total) { 77 tests_failed += 1; 78 // last_failed = tests_total; 79 // } 60 tests_failed += 1; 80 61 } 81 62 } … … 86 67 if (!passed) { 87 68 printf("failed test %3d: fill T1 A\n", tests_total); 88 // if (last_failed != tests_total) { 89 tests_failed += 1; 90 // last_failed = tests_total; 91 // } 69 tests_failed += 1; 92 70 } 93 71 } … … 100 78 if (!passed) { 101 79 printf("failed test %3d: use int\n", tests_total); 102 // if (last_failed != tests_total) { 103 tests_failed += 1; 104 // last_failed = tests_total; 105 // } 80 tests_failed += 1; 106 81 } 107 82 } … … 114 89 if (!passed) { 115 90 printf("failed test %3d: use T1\n", tests_total); 116 // if (last_failed != tests_total) { 117 tests_failed += 1; 118 // last_failed = tests_total; 119 // } 91 tests_failed += 1; 120 92 } 121 93 } … … 331 303 free(ip); 332 304 333 //ip = alloc( 0, ((int*)0p)`realloc, FillT`fill );334 //est_base(ip, 0, libAlign);335 //free(ip);305 ip = alloc( 0, ((int*)0p)`realloc, FillT`fill ); 306 test_base(ip, 0, libAlign); 307 free(ip); 336 308 337 309 ip = alloc( align`align ); … … 356 328 free(ip); 357 329 358 //ip = alloc( ((int*)0p)`realloc, align`align );359 //est_base(ip, elemSize, align);360 //est_use(ip, elemSize / elemSize);361 //free(ip);330 ip = alloc( ((int*)0p)`realloc, align`align ); 331 test_base(ip, elemSize, align); 332 test_use(ip, elemSize / elemSize); 333 free(ip); 362 334 363 335 dp = alloc( dim ); … … 367 339 free(ip); 368 340 369 //ip = alloc( ((double*)0p)`resize, align`align );370 //est_base(ip, elemSize, align);371 //est_use(ip, elemSize / elemSize);372 //free(ip);341 ip = alloc( ((double*)0p)`resize, align`align ); 342 test_base(ip, elemSize, align); 343 test_use(ip, elemSize / elemSize); 344 free(ip); 373 345 374 346 op = alloc( dim, ((int)0xdeadbeef)`fill); … … 384 356 free(ip); 385 357 386 //ip = alloc( dim, ((int*)0p)`realloc, align`align );387 //est_base(ip, size, align);388 //est_use(ip, size / elemSize);389 //free(ip);390 391 //ip = alloc( 0, ((int*)0p)`realloc, align`align );392 // est_base(ip, 0, align);393 //free(ip);358 ip = alloc( dim, ((int*)0p)`realloc, align`align ); 359 test_base(ip, size, align); 360 test_use(ip, size / elemSize); 361 free(ip); 362 363 ip = alloc( 0, ((int*)0p)`realloc, align`align ); 364 test_base(ip, 0, libAlign); 365 free(ip); 394 366 395 367 ip = alloc( align`align, FillC`fill ); … … 462 434 free(ip); 463 435 464 //ip = alloc( dim, ((int*)0p)`realloc, align`align, FillC`fill );465 //est_base(ip, size, align);466 //est_fill(ip, 0, size, FillC);467 //est_use(ip, size / elemSize);468 //free(ip);469 470 //ip = alloc( 0, ((int*)0p)`realloc, align`align, FillC`fill );471 // est_base(ip, 0, align);472 //free(ip);436 ip = alloc( dim, ((int*)0p)`realloc, align`align, FillC`fill ); 437 test_base(ip, size, align); 438 test_fill(ip, 0, size, FillC); 439 test_use(ip, size / elemSize); 440 free(ip); 441 442 ip = alloc( 0, ((int*)0p)`realloc, align`align, FillC`fill ); 443 test_base(ip, 0, libAlign); 444 free(ip); 473 445 474 446 op = alloc( dim, ((int)0xdeadbeef)`fill ); … … 499 471 free(ip); 500 472 501 //ip = alloc( dim, ((int*)0p)`realloc, align`align, FillT`fill );502 //est_base(ip, size, align);503 //est_fill(ip, 0, dim, FillT);504 //est_use(ip, size / elemSize);505 //free(ip);506 507 //ip = alloc( 0, ((int*)0p)`realloc, align`align, FillT`fill );508 // est_base(ip, 0, align);509 //free(ip);473 ip = alloc( dim, ((int*)0p)`realloc, align`align, FillT`fill ); 474 test_base(ip, size, align); 475 test_fill(ip, 0, dim, FillT); 476 test_use(ip, size / elemSize); 477 free(ip); 478 479 ip = alloc( 0, ((int*)0p)`realloc, align`align, FillT`fill ); 480 test_base(ip, 0, libAlign); 481 free(ip); 510 482 511 483 if (tests_failed == 0) printf("PASSED alloc tests\n\n"); … … 704 676 free(t1p); 705 677 706 // t1p = alloc( (T1*)0p, 0, FillT1);707 // est_base(t1p, 0, tAlign);708 //free(t1p);678 t1p = alloc( 0, ((T1*)0p)`realloc, FillT1`fill ); 679 test_base(t1p, 0, libAlign); 680 free(t1p); 709 681 710 682 t1p = alloc( align`align ); … … 729 701 free(t1p); 730 702 731 //t1p = alloc( ((T1*)0p)`realloc, align`align );732 //est_base(t1p, elemSize, align);733 //est_use(t1p, elemSize / elemSize);734 //free(t1p);703 t1p = alloc( ((T1*)0p)`realloc, align`align ); 704 test_base(t1p, elemSize, align); 705 test_use(t1p, elemSize / elemSize); 706 free(t1p); 735 707 736 708 dp = alloc( dim ); … … 740 712 free(t1p); 741 713 742 //t1p = alloc( ((double*)0p)`resize, align`align );743 //est_base(t1p, elemSize, align);744 //est_use(t1p, elemSize / elemSize);745 //free(t1p);714 t1p = alloc( ((double*)0p)`resize, align`align ); 715 test_base(t1p, elemSize, align); 716 test_use(t1p, elemSize / elemSize); 717 free(t1p); 746 718 747 719 t1op = alloc( dim, ((T1){0xdeadbeef})`fill ); … … 757 729 free(t1p); 758 730 759 //t1p = alloc( dim, ((T1*)0p)`realloc, align`align );760 //est_base(t1p, size, align);761 //est_use(t1p, size / elemSize);762 //free(t1p);763 764 //t1p = alloc( 0, ((T1*)0p)`realloc, align`align );765 // est_base(t1p, 0, align);766 //free(t1p);731 t1p = alloc( dim, ((T1*)0p)`realloc, align`align ); 732 test_base(t1p, size, align); 733 test_use(t1p, size / elemSize); 734 free(t1p); 735 736 t1p = alloc( 0, ((T1*)0p)`realloc, align`align ); 737 test_base(t1p, 0, libAlign); 738 free(t1p); 767 739 768 740 t1p = alloc( align`align, FillC`fill ); … … 835 807 free(t1p); 836 808 837 //t1p = alloc( dim, ((T1*)0p)`realloc, align`align, FillC`fill );838 //est_base(t1p, size, align);839 //est_fill(t1p, 0, size, FillC);840 //est_use(t1p, size / elemSize);841 //free(t1p);842 843 //t1p = alloc( 0, ((T1*)0p)`realloc, align`align, FillC`fill );844 // est_base(t1p, 0, align);845 //free(t1p);809 t1p = alloc( dim, ((T1*)0p)`realloc, align`align, FillC`fill ); 810 test_base(t1p, size, align); 811 test_fill(t1p, 0, size, FillC); 812 test_use(t1p, size / elemSize); 813 free(t1p); 814 815 t1p = alloc( 0, ((T1*)0p)`realloc, align`align, FillC`fill ); 816 test_base(t1p, 0, libAlign); 817 free(t1p); 846 818 847 819 t1op = alloc( dim, ((T1){0xdeadbeef})`fill); … … 872 844 free(t1p); 873 845 874 // t1p = alloc( dim, ((T1*)0p)`realloc, align`aling, FillT1`fill );875 //est_base(t1p, size, align);876 //est_fill(t1p, 0, dim, FillT1);877 //est_use(t1p, size / elemSize);878 //free(t1p);879 880 //t1p = alloc( 0, ((T1*)0p)`realloc, align`align, FillT1`fill );881 // est_base(t1p, 0, align);882 //free(t1p);846 t1p = alloc( dim, ((T1*)0p)`realloc, align`align, FillT1`fill ); 847 test_base(t1p, size, align); 848 test_fill(t1p, 0, dim, FillT1); 849 test_use(t1p, size / elemSize); 850 free(t1p); 851 852 t1p = alloc( 0, ((T1*)0p)`realloc, align`align, FillT1`fill ); 853 test_base(t1p, 0, libAlign); 854 free(t1p); 883 855 884 856 if (tests_failed == 0) printf("PASSED alloc tests (aligned struct)\n\n"); -
tests/concurrent/examples/boundedBufferEXT.cfa
r5a1c9ef r1c507eb 1 1 // 2 2 // Cforall Version 1.0.0 Copyright (C) 2018 University of Waterloo 3 // 3 // 4 4 // The contents of this file are covered under the licence agreement in the 5 5 // file "LICENCE" distributed with Cforall. … … 87 87 } 88 88 89 enum { Prods = 4, Cons = 5 }; 90 Producer * prods[Prods]; 91 Consumer * cons[Cons]; 92 89 93 int main() { 90 94 Buffer(int) buffer; 91 enum { Prods = 4, Cons = 5 };92 Producer * prods[Prods];93 Consumer * cons[Cons];94 95 int sums[Cons]; 95 96 int i; -
tests/errors/.expect/completeType.x86.txt
r5a1c9ef r1c507eb 6 6 Name: x 7 7 8 ... to: nothing 9 with resolved type: 10 void Alternatives are: 8 ... to: nothing Alternatives are: 11 9 Cost ( 0, 1, 2, 0, 1, -1, 0 ): Generated Cast of: 12 10 Application of … … 22 20 23 21 24 with resolved type:25 pointer to forall26 _89_4_DT: data type27 function28 ... with parameters29 intrinsic pointer to instance of type _89_4_DT (not function type)30 ... returning31 _retval__operator_deref: reference to instance of type _89_4_DT (not function type)32 ... with attributes:33 Attribute with name: unused34 35 36 22 ... to arguments 37 23 Variable Expression: x: pointer to instance of struct A with body 0 38 with resolved type:39 pointer to instance of struct A with body 040 24 41 with resolved type:42 reference to instance of struct A with body 043 25 ... to: nothing 44 with resolved type:45 void46 26 (types: 47 27 void … … 63 43 64 44 65 with resolved type:66 pointer to forall67 _89_4_DT: data type68 function69 ... with parameters70 intrinsic pointer to instance of type _89_4_DT (not function type)71 ... returning72 _retval__operator_deref: reference to instance of type _89_4_DT (not function type)73 ... with attributes:74 Attribute with name: unused75 76 77 45 ... to arguments 78 46 Variable Expression: x: pointer to instance of struct B with body 1 79 with resolved type:80 pointer to instance of struct B with body 181 47 82 with resolved type:83 reference to instance of struct B with body 184 48 ... to: nothing 85 with resolved type:86 void87 49 (types: 88 50 void … … 159 121 ... returning nothing 160 122 161 with resolved type:162 pointer to forall163 _108_0_T: sized data type164 ... with assertions165 ?=?: pointer to function166 ... with parameters167 reference to instance of type _108_0_T (not function type)168 instance of type _108_0_T (not function type)169 ... returning170 _retval__operator_assign: instance of type _108_0_T (not function type)171 ... with attributes:172 Attribute with name: unused173 174 175 ?{}: pointer to function176 ... with parameters177 reference to instance of type _108_0_T (not function type)178 ... returning nothing179 180 ?{}: pointer to function181 ... with parameters182 reference to instance of type _108_0_T (not function type)183 instance of type _108_0_T (not function type)184 ... returning nothing185 186 ^?{}: pointer to function187 ... with parameters188 reference to instance of type _108_0_T (not function type)189 ... returning nothing190 191 192 function193 ... with parameters194 pointer to instance of type _108_0_T (not function type)195 ... returning nothing196 197 123 ... to arguments 198 124 Variable Expression: z: pointer to instance of type T (not function type) 199 with resolved type:200 pointer to instance of type T (not function type)201 125 202 with resolved type:203 void204 126 (types: 205 127 void -
tests/malloc.cfa
r5a1c9ef r1c507eb 252 252 253 253 ip = (int *) (void *) malloc( size ); 254 ip = (int *) (void *) resize( (void *) ip, libAlign, size / 2 ); 255 test_base(ip, size / 2, libAlign); 256 test_use(ip); 257 free(ip); 258 259 ip = (int *) (void *) aligned_alloc( align, size ); 260 ip = (int *) (void *) resize( (void *) ip, align, size / 2 ); 261 test_base(ip, size / 2, align); 262 test_use(ip); 263 free(ip); 264 265 ip = (int *) (void *) malloc( size ); 254 266 ip = (int *) (void *) resize( (void *) ip, align, size / 4 ); 255 267 test_base(ip, size / 4, align); … … 270 282 ip = (int *) (void *) resize( 0p, align, size ); 271 283 test_base(ip, size, align); 284 test_use(ip); 285 free(ip); 286 287 ip = (int *) (void *) calloc( dim, elemSize ); 288 ip = (int *) (void *) realloc( (void *) ip, libAlign, size / 2 ); 289 test_base(ip, size / 2, libAlign); 290 test_fill(ip, 0, size / 2, '\0'); 291 test_use(ip); 292 free(ip); 293 294 ip = (int *) (void *) cmemalign( align, dim, elemSize ); 295 ip = (int *) (void *) realloc( (void *) ip, align, size / 2 ); 296 test_base(ip, size / 2, align); 297 test_fill(ip, 0, size / 2, '\0'); 272 298 test_use(ip); 273 299 free(ip); … … 348 374 free(ip); 349 375 350 ip = resize( NULL, size );351 test_base(ip, size, libAlign); 352 test_use(ip); 353 free(ip); 354 355 ip = resize( 0p, size );376 ip = resize( (int*)0p, size ); 377 test_base(ip, size, libAlign); 378 test_use(ip); 379 free(ip); 380 381 ip = resize( (int*)0p, size ); 356 382 test_base(ip, size, libAlign); 357 383 test_use(ip); … … 378 404 free(ip); 379 405 380 ip = realloc( NULL, size );406 ip = realloc( (int*)0p, size ); 381 407 test_base(ip, size , libAlign); 382 408 test_use(ip); 383 409 free(ip); 384 410 385 ip = realloc( 0p, size );411 ip = realloc( (int*)0p, size ); 386 412 test_base(ip, size, libAlign); 387 413 test_use(ip); … … 437 463 else printf("failed CFA malloc tests : %d/%d\n\n", tests_failed, tests_total); 438 464 439 // testing CFA malloc 465 // testing CFA malloc with aligned struct 440 466 441 467 elemSize = sizeof(T1); … … 488 514 free(tp); 489 515 490 tp = resize( NULL, size );516 tp = resize( (T1*)0p, size ); 491 517 test_base(tp, size, tAlign ); 492 518 test_use(tp); 493 519 free(tp); 494 520 495 tp = resize( 0p, size );521 tp = resize( (T1*)0p, size ); 496 522 test_base(tp, size, tAlign ); 497 523 test_use(tp); … … 518 544 free(tp); 519 545 520 tp = realloc( NULL, size );546 tp = realloc( (T1*)0p, size ); 521 547 test_base(tp, size , tAlign ); 522 548 test_use(tp); 523 549 free(tp); 524 550 525 tp = realloc( 0p, size );551 tp = realloc( (T1*)0p, size ); 526 552 test_base(tp, size, tAlign ); 527 553 test_use(tp); … … 559 585 free(tp); 560 586 561 (int) posix_memalign( ( int**) &tp, align );587 (int) posix_memalign( (T1 **) &tp, align ); 562 588 test_base(tp, elemSize, align); 563 589 test_use(tp); -
tests/test.py
r5a1c9ef r1c507eb 116 116 parser.add_argument('--arch', help='Test for specific architecture', type=comma_separated(str), default=None) 117 117 parser.add_argument('--continue', help='When multiple specifications are passed (debug/install/arch), sets whether or not to continue if the last specification failed', type=yes_no, default='yes', dest='continue_') 118 parser.add_argument('--timeout', help='Maximum duration in seconds after a single test is considered to have timed out', type=int, default= 60)118 parser.add_argument('--timeout', help='Maximum duration in seconds after a single test is considered to have timed out', type=int, default=120) 119 119 parser.add_argument('--global-timeout', help='Maximum cumulative duration in seconds after the ALL tests are considered to have timed out', type=int, default=7200) 120 120 parser.add_argument('--timeout-with-gdb', help='Instead of killing the command when it times out, orphan it and print process id to allow gdb to attach', type=yes_no, default="no")
Note: See TracChangeset
for help on using the changeset viewer.