Rev 3149 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 3149 | Rev 3153 | ||
---|---|---|---|
Line 51... | Line 51... | ||
51 | if (!quiet) |
51 | if (!quiet) |
52 | printf("Allocating %d items...", count); |
52 | printf("Allocating %d items...", count); |
53 | 53 | ||
54 | for (i = 0; i < count; i++) { |
54 | for (i = 0; i < count; i++) { |
55 | data[i] = slab_alloc(cache, 0); |
55 | data[i] = slab_alloc(cache, 0); |
56 | memsetb((uintptr_t) data[i], size, 0); |
56 | memsetb(data[i], size, 0); |
57 | } |
57 | } |
58 | 58 | ||
59 | if (!quiet) { |
59 | if (!quiet) { |
60 | printf("done.\n"); |
60 | printf("done.\n"); |
61 | printf("Freeing %d items...", count); |
61 | printf("Freeing %d items...", count); |
Line 69... | Line 69... | ||
69 | printf("Allocating %d items...", count); |
69 | printf("Allocating %d items...", count); |
70 | } |
70 | } |
71 | 71 | ||
72 | for (i = 0; i < count; i++) { |
72 | for (i = 0; i < count; i++) { |
73 | data[i] = slab_alloc(cache, 0); |
73 | data[i] = slab_alloc(cache, 0); |
74 | memsetb((uintptr_t) data[i], size, 0); |
74 | memsetb(data[i], size, 0); |
75 | } |
75 | } |
76 | 76 | ||
77 | if (!quiet) { |
77 | if (!quiet) { |
78 | printf("done.\n"); |
78 | printf("done.\n"); |
79 | printf("Freeing %d items...", count / 2); |
79 | printf("Freeing %d items...", count / 2); |
Line 87... | Line 87... | ||
87 | printf("Allocating %d items...", count / 2); |
87 | printf("Allocating %d items...", count / 2); |
88 | } |
88 | } |
89 | 89 | ||
90 | for (i = count / 2; i < count; i++) { |
90 | for (i = count / 2; i < count; i++) { |
91 | data[i] = slab_alloc(cache, 0); |
91 | data[i] = slab_alloc(cache, 0); |
92 | memsetb((uintptr_t) data[i], size, 0); |
92 | memsetb(data[i], size, 0); |
93 | } |
93 | } |
94 | 94 | ||
95 | if (!quiet) { |
95 | if (!quiet) { |
96 | printf("done.\n"); |
96 | printf("done.\n"); |
97 | printf("Freeing %d items...", count); |
97 | printf("Freeing %d items...", count); |
Line 149... | Line 149... | ||
149 | for (i = 0; i < THR_MEM_COUNT; i++) |
149 | for (i = 0; i < THR_MEM_COUNT; i++) |
150 | slab_free(thr_cache, thr_data[offs][i]); |
150 | slab_free(thr_cache, thr_data[offs][i]); |
151 | } |
151 | } |
152 | 152 | ||
153 | if (!sh_quiet) |
153 | if (!sh_quiet) |
154 | printf("Thread #" PRIu64 " finished\n", THREAD->tid); |
154 | printf("Thread #%" PRIu64 " finished\n", THREAD->tid); |
155 | 155 | ||
156 | semaphore_up(&thr_sem); |
156 | semaphore_up(&thr_sem); |
157 | } |
157 | } |
158 | 158 | ||
159 | static void testthreads(bool quiet) |
159 | static void testthreads(bool quiet) |