mirror of
https://github.com/sigp/lighthouse.git
synced 2026-05-08 17:26:04 +00:00
Enable jemalloc by default on non windows targets (#5995)
* Enable jemalloc by default on non windows target. * Update `allocator_name` function to check for `target_os` instead as we've deprecated `jemalloc` feature.
This commit is contained in:
8
Makefile
8
Makefile
@@ -14,14 +14,6 @@ BUILD_PATH_AARCH64 = "target/$(AARCH64_TAG)/release"
|
|||||||
PINNED_NIGHTLY ?= nightly
|
PINNED_NIGHTLY ?= nightly
|
||||||
CLIPPY_PINNED_NIGHTLY=nightly-2022-05-19
|
CLIPPY_PINNED_NIGHTLY=nightly-2022-05-19
|
||||||
|
|
||||||
# List of features to use when building natively. Can be overridden via the environment.
|
|
||||||
# No jemalloc on Windows
|
|
||||||
ifeq ($(OS),Windows_NT)
|
|
||||||
FEATURES?=
|
|
||||||
else
|
|
||||||
FEATURES?=jemalloc
|
|
||||||
endif
|
|
||||||
|
|
||||||
# List of features to use when cross-compiling. Can be overridden via the environment.
|
# List of features to use when cross-compiling. Can be overridden via the environment.
|
||||||
CROSS_FEATURES ?= gnosis,slasher-lmdb,slasher-mdbx,jemalloc
|
CROSS_FEATURES ?= gnosis,slasher-lmdb,slasher-mdbx,jemalloc
|
||||||
|
|
||||||
|
|||||||
@@ -22,8 +22,14 @@ gnosis = []
|
|||||||
slasher-mdbx = ["slasher/mdbx"]
|
slasher-mdbx = ["slasher/mdbx"]
|
||||||
# Support slasher LMDB backend.
|
# Support slasher LMDB backend.
|
||||||
slasher-lmdb = ["slasher/lmdb"]
|
slasher-lmdb = ["slasher/lmdb"]
|
||||||
# Use jemalloc.
|
# Deprecated. This is now enabled by default on non windows targets.
|
||||||
jemalloc = ["malloc_utils/jemalloc"]
|
jemalloc = []
|
||||||
|
|
||||||
|
[target.'cfg(not(target_os = "windows"))'.dependencies]
|
||||||
|
malloc_utils = { workspace = true, features = ["jemalloc"] }
|
||||||
|
|
||||||
|
[target.'cfg(target_os = "windows")'.dependencies]
|
||||||
|
malloc_utils = { workspace = true }
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
beacon_node = { workspace = true }
|
beacon_node = { workspace = true }
|
||||||
|
|||||||
@@ -51,10 +51,10 @@ fn bls_library_name() -> &'static str {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn allocator_name() -> &'static str {
|
fn allocator_name() -> &'static str {
|
||||||
if cfg!(feature = "jemalloc") {
|
if cfg!(target_os = "windows") {
|
||||||
"jemalloc"
|
|
||||||
} else {
|
|
||||||
"system"
|
"system"
|
||||||
|
} else {
|
||||||
|
"jemalloc"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user