Subversion Repositories HelenOS-historic

Rev

Rev 815 | Rev 1224 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 815 Rev 822
Line 137... Line 137...
137
        tmp = b->op->find_block(b, block, BUDDY_SYSTEM_INNER_BLOCK);
137
        tmp = b->op->find_block(b, block, BUDDY_SYSTEM_INNER_BLOCK);
138
 
138
 
139
        if (tmp == right) {
139
        if (tmp == right) {
140
            right = left;
140
            right = left;
141
            left = tmp;
141
            left = tmp;
142
        }
142
        }
-
 
143
        ASSERT(tmp == left);
143
        b->op->mark_busy(b, left);
144
        b->op->mark_busy(b, left);
144
        buddy_system_free(b, right);
145
        buddy_system_free(b, right);
145
        b->op->mark_available(b, left);
146
        b->op->mark_available(b, left);
146
    }
147
    }
147
}
148
}
Line 288... Line 289...
288
        if (!list_empty(&b->order[i])) {
289
        if (!list_empty(&b->order[i])) {
289
            for (cur = b->order[i].next; cur != &b->order[i]; cur = cur->next)
290
            for (cur = b->order[i].next; cur != &b->order[i]; cur = cur->next)
290
                cnt++;
291
                cnt++;
291
        }
292
        }
292
   
293
   
293
        printf("#%d\t%d\t%dK\t\t%dK\t\t%d\n", i, cnt, (cnt * (1 << i) * elem_size) >> 10, ((1 << i) * elem_size) >> 10, 1 << i);
294
        printf("#%d\t%d\t%dK\t\t%dK\t\t%d\t", i, cnt, (cnt * (1 << i) * elem_size) >> 10, ((1 << i) * elem_size) >> 10, 1 << i);
-
 
295
        if (!list_empty(&b->order[i])) {
-
 
296
            for (cur = b->order[i].next; cur != &b->order[i]; cur = cur->next) {
-
 
297
                b->op->print_id(b, cur);
-
 
298
                printf(" ");
-
 
299
            }
-
 
300
        }
-
 
301
        printf("\n");
294
       
302
           
295
        block_count += cnt;
303
        block_count += cnt;
296
        elem_count += (1 << i) * cnt;
304
        elem_count += (1 << i) * cnt;
297
    }
305
    }
298
    printf("-----\t------\t--------\t----------\t---------------\n");
306
    printf("-----\t------\t--------\t----------\t---------------\n");
299
    printf("Buddy system contains %d free elements (%d blocks)\n" , elem_count, block_count);
307
    printf("Buddy system contains %d free elements (%d blocks)\n" , elem_count, block_count);