mirror of
https://github.com/microsoft/mimalloc.git
synced 2025-07-06 19:38:41 +03:00
Merge branch 'dev' into dev-slice
This commit is contained in:
commit
b7046934e5
10 changed files with 148 additions and 50 deletions
|
@ -303,13 +303,17 @@ static void test_aslr(void) {
|
|||
}
|
||||
|
||||
static void test_process_info(void) {
|
||||
double utime = 0;
|
||||
double stime = 0;
|
||||
size_t user_msecs = 0;
|
||||
size_t system_msecs = 0;
|
||||
size_t current_rss = 0;
|
||||
size_t peak_rss = 0;
|
||||
size_t current_commit = 0;
|
||||
size_t peak_commit = 0;
|
||||
size_t page_faults = 0;
|
||||
mi_process_info(&utime, &stime, ¤t_rss, &peak_rss, ¤t_commit, &peak_commit, &page_faults);
|
||||
printf("process info: user: %.3f s, rss: %zd b, commit: %zd b\n\n", utime, peak_rss, peak_commit);
|
||||
size_t page_faults = 0;
|
||||
for (int i = 0; i < 100000; i++) {
|
||||
void* p = calloc(100,10);
|
||||
free(p);
|
||||
}
|
||||
mi_process_info(&user_msecs, &system_msecs, ¤t_rss, &peak_rss, ¤t_commit, &peak_commit, &page_faults);
|
||||
printf("\n\n*** process info: user: %3zd.%03zd s, rss: %zd b, commit: %zd b\n\n", user_msecs/1000, user_msecs%1000, peak_rss, peak_commit);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue