remove unnecessary malloc imports, remove cargo.toml env check

Signed-off-by: strawberry <strawberry@puppygock.gay>
This commit is contained in:
strawberry 2024-04-10 23:42:37 -04:00 committed by June
parent 9883444486
commit 593bad7780
2 changed files with 2 additions and 14 deletions

View file

@ -308,7 +308,6 @@ hyperlocal = { git = "https://github.com/softprops/hyperlocal", rev = "2ee4d1496
"server",
] } # unix socket support
[target.'cfg(all(not(target_env = "msvc"), not(target_os = "macos"), target_os = "linux"))'.dependencies]
hardened_malloc-rs = { version = "0.1", optional = true, features = [
"static",
"clang",

View file

@ -24,8 +24,6 @@ use ruma::api::client::{
error::{Error as RumaError, ErrorBody, ErrorKind},
uiaa::UiaaResponse,
};
#[cfg(all(not(target_env = "msvc"), feature = "jemalloc", not(feature = "hardened_malloc")))]
use tikv_jemallocator::Jemalloc;
use tokio::{
signal,
sync::oneshot::{self, Sender},
@ -44,16 +42,7 @@ mod routes;
#[cfg(all(not(target_env = "msvc"), feature = "jemalloc", not(feature = "hardened_malloc")))]
#[global_allocator]
static GLOBAL: Jemalloc = Jemalloc;
#[cfg(all(
not(target_env = "msvc"),
not(target_os = "macos"),
not(feature = "jemalloc"),
feature = "hardened_malloc",
target_os = "linux"
))]
use hardened_malloc_rs::HardenedMalloc;
static GLOBAL: tikv_jemallocator::Jemalloc = tikv_jemallocator::Jemalloc;
#[cfg(all(
not(target_env = "msvc"),
@ -63,7 +52,7 @@ use hardened_malloc_rs::HardenedMalloc;
not(feature = "jemalloc")
))]
#[global_allocator]
static GLOBAL: HardenedMalloc = HardenedMalloc;
static GLOBAL: hardened_malloc_rs::HardenedMalloc = hardened_malloc_rs::HardenedMalloc;
struct Server {
config: Config,