Changeset a35b458 in mainline for uspace/app/tester/mm/malloc1.c
- Timestamp:
- 2018-03-02T20:10:49Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- f1380b7
- Parents:
- 3061bc1
- git-author:
- Jiří Zárevúcky <zarevucky.jiri@…> (2018-02-28 17:38:31)
- git-committer:
- Jiří Zárevúcky <zarevucky.jiri@…> (2018-03-02 20:10:49)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/tester/mm/malloc1.c
r3061bc1 ra35b458 208 208 { 209 209 for (unsigned int cycles = 0; /* always */; cycles++) { 210 210 211 211 if ((subphase->cond.max_cycles) && 212 212 (cycles >= subphase->cond.max_cycles)) { … … 217 217 break; 218 218 } 219 219 220 220 /* 221 221 * Decide whether we alloc or free memory in this step. … … 229 229 int alloc = phase->alloc.min_block_size + 230 230 (rand() % (phase->alloc.max_block_size - phase->alloc.min_block_size + 1)); 231 231 232 232 mem_block_t *blk = alloc_block(alloc); 233 233 RETURN_IF_ERROR; 234 234 235 235 if (blk == NULL) { 236 236 TPRINTF("F(A)"); … … 244 244 RETURN_IF_ERROR; 245 245 } 246 246 247 247 } else if (rnd < subphase->prob.free) { 248 248 mem_block_t *blk = get_random_block(); … … 257 257 check_block(blk); 258 258 RETURN_IF_ERROR; 259 259 260 260 free_block(blk); 261 261 RETURN_IF_ERROR; … … 263 263 } 264 264 } 265 265 266 266 TPRINTF("\n.. finished.\n"); 267 267 } … … 271 271 for (unsigned int subno = 0; subno < 3; subno++) { 272 272 subphase_t *subphase = &phase->subphases[subno]; 273 273 274 274 TPRINTF(".. Sub-phase %u (%s)\n", subno + 1, subphase->name); 275 275 do_subphase(phase, subphase); … … 281 281 { 282 282 init_mem(); 283 283 284 284 for (unsigned int phaseno = 0; phaseno < sizeof_array(phases); 285 285 phaseno++) { 286 286 phase_t *phase = &phases[phaseno]; 287 287 288 288 TPRINTF("Entering phase %u (%s)\n", phaseno + 1, phase->name); 289 289 290 290 do_phase(phase); 291 291 if (error_flag) 292 292 break; 293 293 294 294 TPRINTF("Phase finished.\n"); 295 295 } 296 296 297 297 TPRINTF("Cleaning up.\n"); 298 298 done_mem(); 299 299 if (error_flag) 300 300 return "Test failed"; 301 301 302 302 return NULL; 303 303 }
Note:
See TracChangeset
for help on using the changeset viewer.