Skip to content

Commit

Permalink
Use system libc jemalloc instead of tikv-jemallocator on FreeBSD (#2433)
Browse files Browse the repository at this point in the history
On FreeBSD use system provided malloc (which is jemalloc) instead of
the tikv-jemallocator crate.
  • Loading branch information
svenski123 authored Nov 25, 2024
1 parent f320175 commit eb2652b
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion ledger-tool/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ solana_rbpf = { workspace = true, features = ["debugger"] }
thiserror = { workspace = true }
tokio = { workspace = true, features = ["full"] }

[target.'cfg(not(target_env = "msvc"))'.dependencies]
[target.'cfg(not(any(target_env = "msvc", target_os = "freebsd")))'.dependencies]
jemallocator = { workspace = true }

[dev-dependencies]
Expand Down
4 changes: 2 additions & 2 deletions ledger-tool/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -796,10 +796,10 @@ fn record_transactions(
}
}

#[cfg(not(target_env = "msvc"))]
#[cfg(not(any(target_env = "msvc", target_os = "freebsd")))]
use jemallocator::Jemalloc;

#[cfg(not(target_env = "msvc"))]
#[cfg(not(any(target_env = "msvc", target_os = "freebsd")))]
#[global_allocator]
static GLOBAL: Jemalloc = Jemalloc;

Expand Down
2 changes: 1 addition & 1 deletion validator/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ solana-runtime = { workspace = true, features = ["dev-context-only-utils"] }
spl-token-2022 = { workspace = true, features = ["no-entrypoint"] }
tempfile = { workspace = true }

[target.'cfg(not(target_env = "msvc"))'.dependencies]
[target.'cfg(not(any(target_env = "msvc", target_os = "freebsd")))'.dependencies]
jemallocator = { workspace = true }

[target."cfg(unix)".dependencies]
Expand Down
4 changes: 2 additions & 2 deletions validator/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#![allow(clippy::arithmetic_side_effects)]
#[cfg(not(target_env = "msvc"))]
#[cfg(not(any(target_env = "msvc", target_os = "freebsd")))]
use jemallocator::Jemalloc;
use {
agave_validator::{
Expand Down Expand Up @@ -87,7 +87,7 @@ use {
},
};

#[cfg(not(target_env = "msvc"))]
#[cfg(not(any(target_env = "msvc", target_os = "freebsd")))]
#[global_allocator]
static GLOBAL: Jemalloc = Jemalloc;

Expand Down

0 comments on commit eb2652b

Please sign in to comment.