Skip to content

Commit

Permalink
Document JEMALLOC_OVERRIDE (#107)
Browse files Browse the repository at this point in the history
This adds a README paragraph explaining how to provider a prebuilt
version of malloc through `JEMALLOC_OVERRIDE`, as well as build flags
expected by `tikv-jemalloc-sys`.

Signed-off-by: Nicolas Mattia <[email protected]>
  • Loading branch information
nmattia authored Nov 11, 2024
1 parent fa31efd commit 876bc11
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions jemalloc-sys/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,19 @@ hyphens `-` are replaced with underscores `_`(see
virtual address size on those platforms where it knows how, and picks a
default otherwise. This option may be useful when cross-compiling.

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`.

`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

## License
Expand Down

0 comments on commit 876bc11

Please sign in to comment.