Skip to content

Commit

Permalink
feat: ⚡️ use mimalloc as global allocator
Browse files Browse the repository at this point in the history
  • Loading branch information
Jisu-Woniu committed Mar 28, 2024
1 parent 0155917 commit c13c981
Show file tree
Hide file tree
Showing 3 changed files with 77 additions and 65 deletions.
134 changes: 70 additions & 64 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ members = ["crates/rsjudge-grpc", "crates/rsjudge-judger", "crates/rsjudge-rest"
[workspace.package]
version = "0.1.0"
authors = ["NJUPT-SAST"]
license = "Apache-2.0"
edition = "2021"
license = "Apache-2.0"

# clap requires Rust 1.74+ to work
rust-version = "1.74"
Expand Down Expand Up @@ -110,6 +110,7 @@ caps = "0.5.5"
clap = { version = "4.5.3", features = ["derive"] }
env_logger = "0.11.3"
log = "0.4.21"
mimalloc = "0.1.39"
tokio = { version = "1.36.0", features = ["fs", "rt-multi-thread", "macros"] }
toml = "0.8.12"

Expand Down
5 changes: 5 additions & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,15 @@ use caps::{has_cap, CapSet, Capability};
use clap::Parser;
use env_logger::Env;
use log::{debug, info, trace};
use mimalloc::MiMalloc;
use rsjudge_runner::{user::builder, RunAs};
use tokio::fs::read;

use crate::cli::Args;

#[global_allocator]
static GLOBAL: MiMalloc = MiMalloc;

mod cli;

#[tokio::main]
Expand Down

0 comments on commit c13c981

Please sign in to comment.