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"); |
} |