Skip to content

Commit 876bc11

Browse files
authored
Document JEMALLOC_OVERRIDE (#107)
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]>
1 parent fa31efd commit 876bc11

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

jemalloc-sys/README.md

+13
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,19 @@ 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`.
157+
158+
`JEMALLOC_OVERRIDE` is for advanced usage only. Providing your own library means
159+
most features of jemalloc-sys will be ignored in build script, and you are
160+
responsible for compiling the library to match what `jemalloc-sys` expects.
161+
Especially, handle API prefix as whatever feature
162+
`unprefixed_malloc_on_supported_platforms` says.
163+
164+
For more information see [`jemalloc/INSTALL.md`][jemalloc_install].
165+
153166
[jemalloc_install]: https://github.com/jemalloc/jemalloc/blob/dev/INSTALL.md#advanced-configuration
154167

155168
## License

0 commit comments

Comments
 (0)