mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-03 00:31:50 +00:00
Switch allocator to jemalloc (#3697)
## Proposed Changes Another `tree-states` motivated PR, this adds `jemalloc` as the default allocator, with an option to use the system allocator by compiling with `FEATURES="" make`. - [x] Metrics - [x] Test on Windows - [x] Test on macOS - [x] Test with `musl` - [x] Metrics dashboard on `lighthouse-metrics` (https://github.com/sigp/lighthouse-metrics/pull/37) Co-authored-by: Michael Sproul <micsproul@gmail.com>
This commit is contained in:
@@ -4,13 +4,21 @@ version = "0.1.0"
|
||||
authors = ["Paul Hauner <paul@paulhauner.com>"]
|
||||
edition = "2021"
|
||||
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
[dependencies]
|
||||
lighthouse_metrics = { path = "../lighthouse_metrics" }
|
||||
lazy_static = "1.4.0"
|
||||
libc = "0.2.79"
|
||||
parking_lot = "0.12.0"
|
||||
jemalloc-ctl = { version = "0.5.0", optional = true }
|
||||
|
||||
# Jemalloc's background_threads feature requires Linux (pthreads).
|
||||
[target.'cfg(target_os = "linux")'.dependencies]
|
||||
jemallocator = { version = "0.5.0", optional = true, features = ["stats", "background_threads"] }
|
||||
|
||||
[target.'cfg(not(target_os = "linux"))'.dependencies]
|
||||
jemallocator = { version = "0.5.0", optional = true, features = ["stats"] }
|
||||
|
||||
[features]
|
||||
mallinfo2 = []
|
||||
jemalloc = ["jemallocator", "jemalloc-ctl"]
|
||||
jemalloc-profiling = ["jemallocator/profiling"]
|
||||
|
||||
Reference in New Issue
Block a user