Rev 2787 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 2787 | Rev 3424 | ||
---|---|---|---|
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 135... | Line 135... | ||
135 | int i, j; |
135 | int i, j; |
136 | 136 | ||
137 | thread_detach(THREAD); |
137 | thread_detach(THREAD); |
138 | 138 | ||
139 | if (!sh_quiet) |
139 | if (!sh_quiet) |
140 | printf("Starting thread #%llu...\n", THREAD->tid); |
140 | printf("Starting thread #%" PRIu64 "...\n", THREAD->tid); |
141 | 141 | ||
142 | for (j = 0; j < 10; j++) { |
142 | for (j = 0; j < 10; j++) { |
143 | for (i = 0; i < THR_MEM_COUNT; i++) |
143 | for (i = 0; i < THR_MEM_COUNT; i++) |
144 | thr_data[offs][i] = slab_alloc(thr_cache,0); |
144 | thr_data[offs][i] = slab_alloc(thr_cache,0); |
145 | for (i = 0; i < THR_MEM_COUNT / 2; i++) |
145 | for (i = 0; i < THR_MEM_COUNT / 2; i++) |
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 #%llu 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) |