mirror of
https://github.com/microsoft/mimalloc.git
synced 2025-07-06 11:34:38 +03:00
fix statistics accounting of huge pages
This commit is contained in:
parent
ff9f29660b
commit
28d4ec4c5a
3 changed files with 17 additions and 3 deletions
|
@ -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) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue