Changeset 200fcb3 for tests/heap.cfa
- Timestamp:
- Dec 12, 2018, 9:16:12 AM (6 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, no_list, persistent-indexer, pthread-emulation, qualifiedEnum
- Children:
- 5ebb1368
- Parents:
- 3d99498
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
tests/heap.cfa
r3d99498 r200fcb3 10 10 // Created On : Tue Nov 6 17:54:56 2018 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : T hu Nov 8 09:03:54201813 // Update Count : 1 712 // Last Modified On : Tue Dec 11 21:52:40 2018 13 // Update Count : 18 14 14 // 15 15 … … 45 45 for ( i; NoOfAllocs ) { 46 46 locns[i] = alloc( i ); 47 //sout | (void *)locns[i] | endl;47 //sout | (void *)locns[i]; 48 48 for ( k; i ) locns[i][k] = '\345'; 49 49 } // for 50 //sout | (char *)sbrk(0) - start | " bytes" | endl;50 //sout | (char *)sbrk(0) - start | " bytes"; 51 51 52 52 for ( i; NoOfAllocs ) { 53 //sout | (void *)locns[i] | endl;53 //sout | (void *)locns[i]; 54 54 for ( k; i ) if ( locns[i][k] != '\345' ) abort( "new/delete corrupt storage1" ); 55 55 free( locns[i] ); 56 56 } // for 57 //sout | (char *)sbrk(0) - start | " bytes" | endl;57 //sout | (char *)sbrk(0) - start | " bytes"; 58 58 59 59 for ( i; NoOfAllocs ) { 60 60 locns[i] = alloc( i ); 61 //sout | (void *)locns[i] | endl;61 //sout | (void *)locns[i]; 62 62 for ( k; i ) locns[i][k] = '\345'; 63 63 } // for 64 64 for ( i; NoOfAllocs - 1 -~= 0 ) { 65 //sout | (void *)locns[i] | endl;65 //sout | (void *)locns[i]; 66 66 for ( k; i ) if ( locns[i][k] != '\345' ) abort( "new/delete corrupt storage2" ); 67 67 free( locns[i] ); … … 186 186 187 187 for ( a; libAlign() ~= limit ~ a ) { // generate powers of 2 188 //sout | alignments[a] | endl;188 //sout | alignments[a]; 189 189 for ( s; 1 ~ NoOfAllocs ) { // allocation of size 0 can return null 190 190 char * area = (char *)memalign( a, s ); 191 191 if ( area == 0 ) abort( "memalign/free out of memory" ); 192 //sout | i | " " | area | endl;192 //sout | i | " " | area; 193 193 if ( (size_t)area % a != 0 || malloc_alignment( area ) != a ) { // check for initial alignment 194 194 abort( "memalign/free bad alignment : memalign(%d,%d) = %p", (int)a, s, area ); … … 203 203 204 204 for ( a; libAlign() ~= limit ~ a ) { // generate powers of 2 205 //sout | alignments[a] | endl;205 //sout | alignments[a]; 206 206 for ( i; 1 ~ NoOfMmaps ) { 207 207 size_t s = i + default_mmap_start(); // cross over point 208 208 char * area = (char *)memalign( a, s ); 209 209 if ( area == 0 ) abort( "memalign/free out of memory" ); 210 //sout | i | " " | area | endl;210 //sout | i | " " | area; 211 211 if ( (size_t)area % a != 0 || malloc_alignment( area ) != a ) { // check for initial alignment 212 212 abort( "memalign/free bad alignment : memalign(%d,%d) = %p", (int)a, (int)s, area ); … … 268 268 char * area = (char *)memalign( a, amount ); // aligned N-byte allocation 269 269 if ( area == 0 ) abort( "memalign/realloc/free out of memory" ); // no storage ? 270 //sout | alignments[a] | " " | area | endl;270 //sout | alignments[a] | " " | area; 271 271 if ( (size_t)area % a != 0 || malloc_alignment( area ) != a ) { // check for initial alignment 272 272 abort( "memalign/realloc/free bad alignment : memalign(%d,%d) = %p", (int)a, (int)amount, area ); … … 279 279 area = (char *)realloc( area, s ); // attempt to reuse storage 280 280 if ( area == 0 ) abort( "memalign/realloc/free out of memory" ); // no storage ? 281 //sout | i | " " | area | endl;281 //sout | i | " " | area; 282 282 if ( (size_t)area % a != 0 ) { // check for initial alignment 283 283 abort( "memalign/realloc/free bad alignment %p", area ); … … 291 291 292 292 for ( a; libAlign() ~= limit ~ a ) { // generate powers of 2 293 //sout | alignments[a] | endl;293 //sout | alignments[a]; 294 294 for ( s; 1 ~ limit ) { // allocation of size 0 can return null 295 295 char * area = (char *)cmemalign( a, 1, s ); 296 296 if ( area == 0 ) abort( "cmemalign/free out of memory" ); 297 //sout | i | " " | area | endl;297 //sout | i | " " | area; 298 298 if ( (size_t)area % a != 0 || malloc_alignment( area ) != a ) { // check for initial alignment 299 299 abort( "cmemalign/free bad alignment : cmemalign(%d,%d) = %p", (int)a, s, area ); … … 314 314 char * area = (char *)cmemalign( a, 1, amount ); // aligned N-byte allocation 315 315 if ( area == 0 ) abort( "cmemalign/realloc/free out of memory" ); // no storage ? 316 //sout | alignments[a] | " " | area | endl;316 //sout | alignments[a] | " " | area; 317 317 if ( (size_t)area % a != 0 || malloc_alignment( area ) != a ) { // check for initial alignment 318 318 abort( "cmemalign/realloc/free bad alignment : cmemalign(%d,%d) = %p", (int)a, (int)amount, area ); … … 328 328 area = (char *)realloc( area, s ); // attempt to reuse storage 329 329 if ( area == 0 ) abort( "cmemalign/realloc/free out of memory" ); // no storage ? 330 //sout | i | " " | area | endl;330 //sout | i | " " | area; 331 331 if ( (size_t)area % a != 0 || malloc_alignment( area ) != a ) { // check for initial alignment 332 332 abort( "cmemalign/realloc/free bad alignment %p", area ); … … 339 339 free( area ); 340 340 } // for 341 //sout | "worker" | thisTask() | "successful completion" | endl;341 //sout | "worker" | thisTask() | "successful completion"; 342 342 } // Worker main 343 343
Note: See TracChangeset
for help on using the changeset viewer.