3 const size_t kAllocSize
= 16;
4 const size_t kInitialNumAllocs
= 1 << 10;
5 const size_t kPeriodicNumAllocs
= 1 << 10;
6 const size_t kNumIterations
= 1 << 7;
7 const size_t kNumThreads
= 16;
10 char *InitialAllocations
[kInitialNumAllocs
];
11 char *PeriodicaAllocations
[kPeriodicNumAllocs
];
12 for (auto &p
: InitialAllocations
) p
= new char[kAllocSize
];
13 for (size_t i
= 0; i
< kNumIterations
; i
++) {
14 for (size_t j
= 0; j
< kPeriodicNumAllocs
; j
++) {
15 for (auto &p
: PeriodicaAllocations
) {
16 p
= new char[kAllocSize
];
19 for (auto p
: PeriodicaAllocations
) delete [] p
;
22 for (auto p
: InitialAllocations
) delete [] p
;
26 std::thread
*Threads
[kNumThreads
];
27 for (auto &T
: Threads
) T
= new std::thread(&Thread
);
28 for (auto T
: Threads
) {