Subversion Repositories HelenOS-historic

Compare Revisions

Ignore whitespace Rev 768 → Rev 767

/kernel/trunk/test/mm/slab2/test.c
33,7 → 33,6
#include <arch.h>
#include <panic.h>
#include <mm/frame.h>
#include <memstr.h>
 
#define ITEM_SIZE 256
 
65,8 → 64,7
slab_free(cache2,data2);
break;
}
memsetb((__address)data1, ITEM_SIZE, 0);
memsetb((__address)data2, ITEM_SIZE, 0);
 
*((void **)data1) = olddata1;
*((void **)data2) = olddata2;
olddata1 = data1;
90,7 → 88,6
if (!data1) {
panic("Incorrect memory size - use another test.");
}
memsetb((__address)data1, ITEM_SIZE, 0);
*((void **)data1) = olddata1;
olddata1 = data1;
}
100,28 → 97,14
if (!data1) {
break;
}
memsetb((__address)data1, ITEM_SIZE, 0);
*((void **)data1) = olddata1;
olddata1 = data1;
}
slab_print_list();
printf("Deallocating cache1...");
while (olddata1) {
data1 = *((void **)olddata1);
slab_free(cache1, olddata1);
olddata1 = data1;
}
printf("done.\n");
slab_print_list();
slab_cache_destroy(cache1);
slab_cache_destroy(cache2);
}
 
void test(void)
{
printf("Running reclaim test .. pass1\n");
totalmemtest();
printf("Running reclaim test .. pass2\n");
totalmemtest();
printf("Reclaim test OK.\n");
}
/kernel/trunk/test/mm/slab1/test.c
32,7 → 32,6
#include <proc/thread.h>
#include <arch.h>
#include <panic.h>
#include <memstr.h>
 
#define VAL_COUNT 1024
 
51,7 → 50,6
printf("Allocating %d items...", count);
for (i=0; i < count; i++) {
data[i] = slab_alloc(cache, 0);
memsetb((__address)data[i], size, 0);
}
printf("done.\n");
printf("Freeing %d items...", count);
63,7 → 61,6
printf("Allocating %d items...", count);
for (i=0; i < count; i++) {
data[i] = slab_alloc(cache, 0);
memsetb((__address)data[i], size, 0);
}
printf("done.\n");
 
77,7 → 74,6
printf("Allocating %d items...", count/2);
for (i=count/2; i < count; i++) {
data[i] = slab_alloc(cache, 0);
memsetb((__address)data[i], size, 0);
}
printf("done.\n");
printf("Freeing %d items...", count);