microsoft / microsoft/mimalloc

report stats in developer-friendly way

Open
#157 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C
Stars
13.4k
Forks
1.2k
Avg merge
4d 45m
Merged PRs (30d)
13

Description

Currently mimalloc has `mi_stats_print`, which prints build-dependent info to specified file. However if application wants to report this info in another format (e.g. to write it in binary log), it'd have to create temporary file and parse it afterwards. It would be much more efficient and developer-friendly if there was another function that would fill a user-supplied struct with minimal info (present in all types of build). Maybe also some way to report build-specific info as well, though I personally don't need it.

Also a side question - for an existing C++ apllication on Linux, it's impossible to use mi_* functions with `LD_PRELOAD` or by linking with static/dynamic library, right? (Or is it possible by making sure that mimalloc is always `LD_PRELOAD`ed, because if it isn't, it will crash?). The only reliable way to do that is to link with mimalloc-override.o which will override default allocator, correct? Do you have an example on how to do it correctly with cmake?

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the existing mi_stats_print entry point, then inspect mimalloc-override.o and the CMake setup relevant to Linux C++ applications. Clarify whether the work covers a minimal stats struct, build-specific reporting, allocator loading/linking guidance, or all three. Done means the agreed scope is implemented and the requested usage example is provided.

Written by the indexing model from the issue text.

Assessment

Tech stack
c, cmake, cpp, linux
Domain
build-system, performance
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.