From 415aba59bdbd9eef4d520065773edee84b6bff6e Mon Sep 17 00:00:00 2001 From: Thomas Linford Date: Fri, 3 Feb 2023 10:02:55 +0100 Subject: setup jemalloc --- Cargo.lock | 28 ++++++++++++++++++++++++++++ Cargo.toml | 1 + src/main.rs | 5 +++++ 3 files changed, 34 insertions(+) diff --git a/Cargo.lock b/Cargo.lock index fb040fad2..16ef133b3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -996,6 +996,12 @@ dependencies = [ "percent-encoding", ] +[[package]] +name = "fs_extra" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2022715d62ab30faffd124d40b76f4134a550a87792276512b18d63272333394" + [[package]] name = "futures-channel" version = "0.3.21" @@ -2985,6 +2991,27 @@ dependencies = [ "winapi", ] +[[package]] +name = "tikv-jemalloc-sys" +version = "0.5.2+5.3.0-patched" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec45c14da997d0925c7835883e4d5c181f196fa142f8c19d7643d1e9af2592c3" +dependencies = [ + "cc", + "fs_extra", + "libc", +] + +[[package]] +name = "tikv-jemallocator" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "20612db8a13a6c06d57ec83953694185a367e16945f66565e8028d2c0bd76979" +dependencies = [ + "libc", + "tikv-jemalloc-sys", +] + [[package]] name = "time" version = "0.1.44" @@ -3960,6 +3987,7 @@ dependencies = [ "ssh2", "suggest", "thiserror", + "tikv-jemallocator", "zellij-client", "zellij-server", "zellij-utils", diff --git a/Cargo.toml b/Cargo.toml index bb1bfbce8..64ff8ad62 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -23,6 +23,7 @@ zellij-utils = { path = "zellij-utils/", version = "0.36.0" } log = "0.4.17" dialoguer = "0.10.1" suggest = "0.4" +tikv-jemallocator = "0.5.0" [dev-dependencies] insta = { version = "1.6.0", features = ["backtrace"] } diff --git a/src/main.rs b/src/main.rs index 54ca71cb4..80ff325bb 100644 --- a/src/main.rs +++ b/src/main.rs @@ -3,6 +3,11 @@ mod sessions; #[cfg(test)] mod tests; +use tikv_jemallocator::Jemalloc; + +#[global_allocator] +static GLOBAL: Jemalloc = Jemalloc; + use zellij_utils::{ clap::Parser, cli::{CliAction, CliArgs, Command, Sessions}, -- cgit v1.2.3