Subversion Repositories HelenOS-historic

Rev

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

Rev 766 Rev 768
Line 30... Line 30...
30
#include <mm/slab.h>
30
#include <mm/slab.h>
31
#include <print.h>
31
#include <print.h>
32
#include <proc/thread.h>
32
#include <proc/thread.h>
33
#include <arch.h>
33
#include <arch.h>
34
#include <panic.h>
34
#include <panic.h>
-
 
35
#include <memstr.h>
35
 
36
 
36
#define VAL_COUNT   1024
37
#define VAL_COUNT   1024
37
 
38
 
38
void * data[VAL_COUNT];
39
void * data[VAL_COUNT];
39
 
40
 
Line 48... Line 49...
48
    slab_print_list();
49
    slab_print_list();
49
   
50
   
50
    printf("Allocating %d items...", count);
51
    printf("Allocating %d items...", count);
51
    for (i=0; i < count; i++) {
52
    for (i=0; i < count; i++) {
52
        data[i] = slab_alloc(cache, 0);
53
        data[i] = slab_alloc(cache, 0);
-
 
54
        memsetb((__address)data[i], size, 0);
53
    }
55
    }
54
    printf("done.\n");
56
    printf("done.\n");
55
    printf("Freeing %d items...", count);
57
    printf("Freeing %d items...", count);
56
    for (i=0; i < count; i++) {
58
    for (i=0; i < count; i++) {
57
        slab_free(cache, data[i]);
59
        slab_free(cache, data[i]);
Line 59... Line 61...
59
    printf("done.\n");
61
    printf("done.\n");
60
 
62
 
61
    printf("Allocating %d items...", count);
63
    printf("Allocating %d items...", count);
62
    for (i=0; i < count; i++) {
64
    for (i=0; i < count; i++) {
63
        data[i] = slab_alloc(cache, 0);
65
        data[i] = slab_alloc(cache, 0);
-
 
66
        memsetb((__address)data[i], size, 0);
64
    }
67
    }
65
    printf("done.\n");
68
    printf("done.\n");
66
 
69
 
67
    slab_print_list();
70
    slab_print_list();
68
    printf("Freeing %d items...", count/2);
71
    printf("Freeing %d items...", count/2);
Line 72... Line 75...
72
    printf("done.\n"); 
75
    printf("done.\n"); 
73
 
76
 
74
    printf("Allocating %d items...", count/2);
77
    printf("Allocating %d items...", count/2);
75
    for (i=count/2; i < count; i++) {
78
    for (i=count/2; i < count; i++) {
76
        data[i] = slab_alloc(cache, 0);
79
        data[i] = slab_alloc(cache, 0);
-
 
80
        memsetb((__address)data[i], size, 0);
77
    }
81
    }
78
    printf("done.\n");
82
    printf("done.\n");
79
    printf("Freeing %d items...", count);
83
    printf("Freeing %d items...", count);
80
    for (i=0; i < count; i++) {
84
    for (i=0; i < count; i++) {
81
        slab_free(cache, data[i]);
85
        slab_free(cache, data[i]);