Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/app/tester/mm/malloc3.c

    r582a0b8 ra35b458  
    200200{
    201201        for (unsigned int cycles = 0; /* always */; cycles++) {
    202                
     202
    203203                if ((subphase->cond.max_cycles) &&
    204204                    (cycles >= subphase->cond.max_cycles)) {
     
    209209                        break;
    210210                }
    211                
     211
    212212                /*
    213213                 * Decide whether we alloc or free memory in this step.
     
    221221                        int alloc = phase->alloc.min_block_size +
    222222                            (rand() % (phase->alloc.max_block_size - phase->alloc.min_block_size + 1));
    223                        
     223
    224224                        mem_block_t *blk = alloc_block(alloc);
    225225                        RETURN_IF_ERROR;
    226                        
     226
    227227                        if (blk == NULL) {
    228228                                TPRINTF("F(A)");
     
    235235                                fill_block(blk);
    236236                                RETURN_IF_ERROR;
    237                                
     237
    238238                                if ((mem_blocks_count % AREA_GRANULARITY) == 0) {
    239239                                        mem_area_t *area = map_area(AREA_SIZE);
    240240                                        RETURN_IF_ERROR;
    241                                        
     241
    242242                                        if (area != NULL) {
    243243                                                TPRINTF("*");
     
    248248                                }
    249249                        }
    250                        
     250
    251251                } else if (rnd < subphase->prob.free) {
    252252                        mem_block_t *blk = get_random_block();
     
    261261                                check_block(blk);
    262262                                RETURN_IF_ERROR;
    263                                
     263
    264264                                free_block(blk);
    265265                                RETURN_IF_ERROR;
     
    267267                }
    268268        }
    269        
     269
    270270        TPRINTF("\n..  finished.\n");
    271271}
     
    275275        for (unsigned int subno = 0; subno < 3; subno++) {
    276276                subphase_t *subphase = &phase->subphases[subno];
    277                
     277
    278278                TPRINTF(".. Sub-phase %u (%s)\n", subno + 1, subphase->name);
    279279                do_subphase(phase, subphase);
     
    285285{
    286286        init_mem();
    287        
     287
    288288        for (unsigned int phaseno = 0; phaseno < sizeof_array(phases);
    289289            phaseno++) {
    290290                phase_t *phase = &phases[phaseno];
    291                
     291
    292292                TPRINTF("Entering phase %u (%s)\n", phaseno + 1, phase->name);
    293                
     293
    294294                do_phase(phase);
    295295                if (error_flag)
    296296                        break;
    297                
     297
    298298                TPRINTF("Phase finished.\n");
    299299        }
    300        
     300
    301301        TPRINTF("Cleaning up.\n");
    302302        done_mem();
    303303        if (error_flag)
    304304                return "Test failed";
    305        
     305
    306306        return NULL;
    307307}
Note: See TracChangeset for help on using the changeset viewer.