summaryrefslogtreecommitdiffstats
path: root/msvc/projects/vc2015
diff options
context:
space:
mode:
authorrustyx <me@rustyx.org>2016-02-26 16:18:58 (GMT)
committerrustyx <me@rustyx.org>2016-02-26 16:18:58 (GMT)
commit4c4ee292e411b0b2381e7b5e8f7c34d480cda99a (patch)
treed190821855bec4b0331455d568c09967b303d4d0 /msvc/projects/vc2015
parentebd00e95b863c790d085c906a9aeddd22bd19d69 (diff)
downloadjemalloc-4c4ee292e411b0b2381e7b5e8f7c34d480cda99a.zip
jemalloc-4c4ee292e411b0b2381e7b5e8f7c34d480cda99a.tar.gz
jemalloc-4c4ee292e411b0b2381e7b5e8f7c34d480cda99a.tar.bz2
Improve test_threads performance
Diffstat (limited to 'msvc/projects/vc2015')
-rw-r--r--msvc/projects/vc2015/test_threads/test_threads.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/msvc/projects/vc2015/test_threads/test_threads.cpp b/msvc/projects/vc2015/test_threads/test_threads.cpp
index 046843f..603bdce 100644
--- a/msvc/projects/vc2015/test_threads/test_threads.cpp
+++ b/msvc/projects/vc2015/test_threads/test_threads.cpp
@@ -58,22 +58,22 @@ int test_threads()
thread t([&]() {
for (int i = 0; i < numIter2; ++i) {
const int numAllocs = numAllocsMax - sizeDist(rnd);
- for (int j = 0; j < numAllocs; j++) {
+ for (int j = 0; j < numAllocs; j += 64) {
const int x = sizeDist(rnd);
const int sz = sizes[x];
ptrsz[j] = sz;
ptrs[j] = (uint8_t*)je_malloc(sz);
if (!ptrs[j]) {
- printf("Unable to allocate %d bytes in thread %d, iter %d, alloc %d. %d", sz, tid, i, j, x);
+ printf("Unable to allocate %d bytes in thread %d, iter %d, alloc %d. %d\n", sz, tid, i, j, x);
exit(1);
}
for (int k = 0; k < sz; k++)
ptrs[j][k] = tid + k;
}
- for (int j = 0; j < numAllocs; j++) {
+ for (int j = 0; j < numAllocs; j += 64) {
for (int k = 0, sz = ptrsz[j]; k < sz; k++)
if (ptrs[j][k] != (uint8_t)(tid + k)) {
- printf("Memory error in thread %d, iter %d, alloc %d @ %d : %02X!=%02X", tid, i, j, k, ptrs[j][k], (uint8_t)(tid + k));
+ printf("Memory error in thread %d, iter %d, alloc %d @ %d : %02X!=%02X\n", tid, i, j, k, ptrs[j][k], (uint8_t)(tid + k));
exit(1);
}
je_free(ptrs[j]);