mirror of
https://github.com/microsoft/mimalloc.git
synced 2025-07-06 19:38:41 +03:00
initial statistics api
This commit is contained in:
parent
1b749ea7d8
commit
09ad6d2819
11 changed files with 380 additions and 179 deletions
|
@ -36,7 +36,7 @@ static int ITER = 400;
|
|||
static int THREADS = 8;
|
||||
static int SCALE = 25;
|
||||
static int ITER = 20;
|
||||
#elif defined(MI_GUARDED) // with debug guard pages reduce parameters to stay within the azure pipeline limits
|
||||
#elif 1 || defined(MI_GUARDED) // with debug guard pages reduce parameters to stay within the azure pipeline limits
|
||||
static int THREADS = 8;
|
||||
static int SCALE = 10;
|
||||
static int ITER = 10;
|
||||
|
@ -61,6 +61,7 @@ static bool main_participates = false; // main thread participates as a
|
|||
#define custom_free(p) free(p)
|
||||
#else
|
||||
#include <mimalloc.h>
|
||||
#include <mimalloc-stats.h>
|
||||
#define custom_calloc(n,s) mi_calloc(n,s)
|
||||
#define custom_realloc(p,s) mi_realloc(p,s)
|
||||
#define custom_free(p) mi_free(p)
|
||||
|
@ -330,8 +331,15 @@ int main(int argc, char** argv) {
|
|||
#ifndef NDEBUG
|
||||
mi_debug_show_arenas();
|
||||
mi_collect(true);
|
||||
|
||||
const char* json = mi_stats_get_json(0, NULL);
|
||||
if (json != NULL) {
|
||||
puts(json);
|
||||
mi_free(json);
|
||||
}
|
||||
|
||||
#endif
|
||||
mi_stats_print(NULL);
|
||||
mi_stats_print(NULL);
|
||||
#endif
|
||||
//bench_end_program();
|
||||
return 0;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue