fix statistics accounting of huge pages

This commit is contained in:
daan 2019-10-28 13:14:14 -07:00
parent ff9f29660b
commit 28d4ec4c5a
3 changed files with 17 additions and 3 deletions

View file

@ -158,6 +158,7 @@ int main(int argc, char** argv) {
//printf("(reserve huge: %i\n)", res);
//bench_start_program();
mi_stats_reset();
memset((void*)transfer, 0, TRANSFERS*sizeof(void*));
run_os_threads(THREADS);
for (int i = 0; i < TRANSFERS; i++) {
@ -165,7 +166,6 @@ int main(int argc, char** argv) {
}
#ifndef NDEBUG
mi_collect(false);
mi_collect(true);
#endif
mi_stats_print(NULL);
//bench_end_program();
@ -191,6 +191,11 @@ static void run_os_threads(size_t nthreads) {
for (size_t i = 0; i < nthreads; i++) {
WaitForSingleObject(thandles[i], INFINITE);
}
for (size_t i = 0; i < nthreads; i++) {
CloseHandle(thandles[i]);
}
free(tids);
free(thandles);
}
static void* atomic_exchange_ptr(volatile void** p, void* newval) {