Ignore:
File:
1 edited

Legend:

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

    r582a0b8 ra35b458  
    208208{
    209209        for (unsigned int cycles = 0; /* always */; cycles++) {
    210                
     210
    211211                if ((subphase->cond.max_cycles) &&
    212212                    (cycles >= subphase->cond.max_cycles)) {
     
    217217                        break;
    218218                }
    219                
     219
    220220                /*
    221221                 * Decide whether we alloc or free memory in this step.
     
    229229                        int alloc = phase->alloc.min_block_size +
    230230                            (rand() % (phase->alloc.max_block_size - phase->alloc.min_block_size + 1));
    231                        
     231
    232232                        mem_block_t *blk = alloc_block(alloc);
    233233                        RETURN_IF_ERROR;
    234                        
     234
    235235                        if (blk == NULL) {
    236236                                TPRINTF("F(A)");
     
    244244                                RETURN_IF_ERROR;
    245245                        }
    246                        
     246
    247247                } else if (rnd < subphase->prob.free) {
    248248                        mem_block_t *blk = get_random_block();
     
    257257                                check_block(blk);
    258258                                RETURN_IF_ERROR;
    259                                
     259
    260260                                free_block(blk);
    261261                                RETURN_IF_ERROR;
     
    263263                }
    264264        }
    265        
     265
    266266        TPRINTF("\n..  finished.\n");
    267267}
     
    271271        for (unsigned int subno = 0; subno < 3; subno++) {
    272272                subphase_t *subphase = &phase->subphases[subno];
    273                
     273
    274274                TPRINTF(".. Sub-phase %u (%s)\n", subno + 1, subphase->name);
    275275                do_subphase(phase, subphase);
     
    281281{
    282282        init_mem();
    283        
     283
    284284        for (unsigned int phaseno = 0; phaseno < sizeof_array(phases);
    285285            phaseno++) {
    286286                phase_t *phase = &phases[phaseno];
    287                
     287
    288288                TPRINTF("Entering phase %u (%s)\n", phaseno + 1, phase->name);
    289                
     289
    290290                do_phase(phase);
    291291                if (error_flag)
    292292                        break;
    293                
     293
    294294                TPRINTF("Phase finished.\n");
    295295        }
    296        
     296
    297297        TPRINTF("Cleaning up.\n");
    298298        done_mem();
    299299        if (error_flag)
    300300                return "Test failed";
    301        
     301
    302302        return NULL;
    303303}
Note: See TracChangeset for help on using the changeset viewer.