mirror of
https://github.com/jemalloc/jemalloc
synced 2026-06-08 15:01:07 +00:00
Add example of static linking
@@ -18,6 +18,12 @@ There are several ways to integrate jemalloc into an application. Here are some
|
||||
cc app.c -o app -L`jemalloc-config --libdir` -Wl,-rpath,`jemalloc-config --libdir` -ljemalloc `jemalloc-config --libs`
|
||||
```
|
||||
|
||||
* Link jemalloc **statically** into the application at build time, and use it as a generic non-replaceable malloc implementation:
|
||||
|
||||
```sh
|
||||
cc app.c -o app `jemalloc-config --libdir`/libjemalloc.a `jemalloc-config --libs`
|
||||
```
|
||||
|
||||
* Compile jemalloc with an API prefix (see the `--with-jemalloc-prefix` configure option), link with jemalloc at build time as above, but use jemalloc distinctly from the system allocator.
|
||||
|
||||
Once you have jemalloc integrated into your application, you can use special features in a variety of ways:
|
||||
|
||||
Reference in New Issue
Block a user