This commit is contained in:
Daan Leijen 2024-12-30 11:44:11 -08:00
commit 02efc57c74

View file

@ -523,9 +523,13 @@ you also need to tell `valgrind` to not intercept those calls itself, and use:
By setting the `MIMALLOC_SHOW_STATS` environment variable you can check that mimalloc is indeed By setting the `MIMALLOC_SHOW_STATS` environment variable you can check that mimalloc is indeed
used and not the standard allocator. Even though the [Valgrind option][valgrind-soname] used and not the standard allocator. Even though the [Valgrind option][valgrind-soname]
is called `--soname-synonyms`, this also is called `--soname-synonyms`, this also works when overriding with a static library or object file.
works when overriding with a static library or object file. Unfortunately, it is not possible to To dynamically override mimalloc using `LD_PRELOAD` together with `valgrind`, use:
dynamically override mimalloc using `LD_PRELOAD` together with `valgrind`.
```
> valgrind --trace-children=yes --soname-synonyms=somalloc=*mimalloc* /usr/bin/env LD_PRELOAD=/usr/lib/libmimalloc.so -- <myprogram>
```
See also the `test/test-wrong.c` file to test with `valgrind`. See also the `test/test-wrong.c` file to test with `valgrind`.
Valgrind support is in its initial development -- please report any issues. Valgrind support is in its initial development -- please report any issues.