Changes in uspace/app/tester/mm/malloc3.c [582a0b8:a35b458] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/tester/mm/malloc3.c
r582a0b8 ra35b458 200 200 { 201 201 for (unsigned int cycles = 0; /* always */; cycles++) { 202 202 203 203 if ((subphase->cond.max_cycles) && 204 204 (cycles >= subphase->cond.max_cycles)) { … … 209 209 break; 210 210 } 211 211 212 212 /* 213 213 * Decide whether we alloc or free memory in this step. … … 221 221 int alloc = phase->alloc.min_block_size + 222 222 (rand() % (phase->alloc.max_block_size - phase->alloc.min_block_size + 1)); 223 223 224 224 mem_block_t *blk = alloc_block(alloc); 225 225 RETURN_IF_ERROR; 226 226 227 227 if (blk == NULL) { 228 228 TPRINTF("F(A)"); … … 235 235 fill_block(blk); 236 236 RETURN_IF_ERROR; 237 237 238 238 if ((mem_blocks_count % AREA_GRANULARITY) == 0) { 239 239 mem_area_t *area = map_area(AREA_SIZE); 240 240 RETURN_IF_ERROR; 241 241 242 242 if (area != NULL) { 243 243 TPRINTF("*"); … … 248 248 } 249 249 } 250 250 251 251 } else if (rnd < subphase->prob.free) { 252 252 mem_block_t *blk = get_random_block(); … … 261 261 check_block(blk); 262 262 RETURN_IF_ERROR; 263 263 264 264 free_block(blk); 265 265 RETURN_IF_ERROR; … … 267 267 } 268 268 } 269 269 270 270 TPRINTF("\n.. finished.\n"); 271 271 } … … 275 275 for (unsigned int subno = 0; subno < 3; subno++) { 276 276 subphase_t *subphase = &phase->subphases[subno]; 277 277 278 278 TPRINTF(".. Sub-phase %u (%s)\n", subno + 1, subphase->name); 279 279 do_subphase(phase, subphase); … … 285 285 { 286 286 init_mem(); 287 287 288 288 for (unsigned int phaseno = 0; phaseno < sizeof_array(phases); 289 289 phaseno++) { 290 290 phase_t *phase = &phases[phaseno]; 291 291 292 292 TPRINTF("Entering phase %u (%s)\n", phaseno + 1, phase->name); 293 293 294 294 do_phase(phase); 295 295 if (error_flag) 296 296 break; 297 297 298 298 TPRINTF("Phase finished.\n"); 299 299 } 300 300 301 301 TPRINTF("Cleaning up.\n"); 302 302 done_mem(); 303 303 if (error_flag) 304 304 return "Test failed"; 305 305 306 306 return NULL; 307 307 }
Note:
See TracChangeset
for help on using the changeset viewer.