Subversion Repositories HelenOS-historic

Compare Revisions

Ignore whitespace Rev 764 → Rev 763

/kernel/trunk/test/mm/slab1/test.c
43,6 → 43,7
 
printf("Creating cache.\n");
cache = slab_cache_create("test_cache", VAL_SIZE, 0, NULL, NULL, SLAB_CACHE_NOMAGAZINE);
slab_print_list();
printf("Destroying cache.\n");
slab_cache_destroy(cache);
 
60,32 → 61,4
slab_free(cache, data[i]);
}
printf("done.\n");
 
printf("Allocating %d items...", VAL_COUNT);
for (i=0; i < VAL_COUNT; i++) {
data[i] = slab_alloc(cache, 0);
}
printf("done.\n");
 
slab_print_list();
printf("Freeing %d items...", VAL_COUNT/2);
for (i=VAL_COUNT-1; i >= VAL_COUNT/2; i--) {
slab_free(cache, data[i]);
}
printf("done.\n");
 
printf("Allocating %d items...", VAL_COUNT/2);
for (i=VAL_COUNT/2; i < VAL_COUNT; i++) {
data[i] = slab_alloc(cache, 0);
}
printf("done.\n");
printf("Freeing %d items...", VAL_COUNT);
for (i=0; i < VAL_COUNT; i++) {
slab_free(cache, data[i]);
}
printf("done.\n");
slab_print_list();
slab_cache_destroy(cache);
 
printf("Test complete.\n");
}