Skip to content

Commit 371568f

Browse files
committed
Document JEMALLOC_OVERRIDE
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`.
1 parent fa31efd commit 371568f

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

jemalloc-sys/README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,14 @@ hyphens `-` are replaced with underscores `_`(see
150150
virtual address size on those platforms where it knows how, and picks a
151151
default otherwise. This option may be useful when cross-compiling.
152152

153+
By default this crate builds and links against a vendored version of `jemalloc`. To
154+
provide your own `jemalloc` version, set `JEMALLOC_OVERRIDE` to point to a built
155+
version of `jemalloc`. This can point to either a shared or static library. For
156+
instance: `JEMALLOC_OVERRIDE=/path/to/libjemalloc.a`. The library should be built
157+
with `jemalloc`'s `--with-jemalloc-prefix=_rjem_`. For static libraries it is also
158+
recommended to build with `--with-private-namespace=_rjem_`. For more information
159+
see [`jemalloc/INSTALL.md`][jemalloc_install].
160+
153161
[jemalloc_install]: https://github.com/jemalloc/jemalloc/blob/dev/INSTALL.md#advanced-configuration
154162

155163
## License

0 commit comments

Comments
 (0)