MCPcopy Create free account
hub / github.com/CppCXY/EmmyLuaCodeStyle / test_process_info

Function test_process_info

3rd/mimalloc-2.0.9/test/main-override-static.c:155–170  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

153}
154
155static void test_process_info(void) {
156 size_t elapsed = 0;
157 size_t user_msecs = 0;
158 size_t system_msecs = 0;
159 size_t current_rss = 0;
160 size_t peak_rss = 0;
161 size_t current_commit = 0;
162 size_t peak_commit = 0;
163 size_t page_faults = 0;
164 for (int i = 0; i < 100000; i++) {
165 void* p = calloc(100,10);
166 free(p);
167 }
168 mi_process_info(&elapsed, &user_msecs, &system_msecs, &current_rss, &peak_rss, &current_commit, &peak_commit, &page_faults);
169 printf("\n\n*** process info: elapsed %3zd.%03zd s, user: %3zd.%03zd s, rss: %zd b, commit: %zd b\n\n", elapsed/1000, elapsed%1000, user_msecs/1000, user_msecs%1000, peak_rss, peak_commit);
170}
171
172static void test_reserved(void) {
173#define KiB 1024ULL

Callers

nothing calls this directly

Calls 1

mi_process_infoFunction · 0.85

Tested by

no test coverage detected