Skip to content

Commit

Permalink
Clarify JEMALLOC_OVERRIDE usage
Browse files Browse the repository at this point in the history
  • Loading branch information
nmattia committed Nov 7, 2024
1 parent 371568f commit 44be6f1
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions jemalloc-sys/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -153,10 +153,15 @@ hyphens `-` are replaced with underscores `_`(see
By default this crate builds and links against a vendored version of `jemalloc`. To
provide your own `jemalloc` version, set `JEMALLOC_OVERRIDE` to point to a built
version of `jemalloc`. This can point to either a shared or static library. For
instance: `JEMALLOC_OVERRIDE=/path/to/libjemalloc.a`. The library should be built
with `jemalloc`'s `--with-jemalloc-prefix=_rjem_`. For static libraries it is also
recommended to build with `--with-private-namespace=_rjem_`. For more information
see [`jemalloc/INSTALL.md`][jemalloc_install].
instance: `JEMALLOC_OVERRIDE=/path/to/libjemalloc.a`.

`JEMALLOC_OVERRIDE` is for advanced usage only. Providing your own library means
most features of jemalloc-sys will be ignored in build script, and you are
responsible for compiling the library to match what `jemalloc-sys` expects.
Especially, handle API prefix as whatever feature
`unprefixed_malloc_on_supported_platforms` says.

For more information see [`jemalloc/INSTALL.md`][jemalloc_install].

[jemalloc_install]: https://github.com/jemalloc/jemalloc/blob/dev/INSTALL.md#advanced-configuration

Expand Down

0 comments on commit 44be6f1

Please sign in to comment.