Browse Source

use mimalloc (#6045)

Nikolay Kim 4 years ago
parent
commit
a8504be183

+ 1 - 1
frameworks/Rust/ntex/Cargo.toml

@@ -17,7 +17,7 @@ path = "src/main_raw.rs"
 
 [dependencies]
 ntex = "0.1.21"
-snmalloc-rs = { version = "0.2.17", features = ["native-cpu"] }
+mimalloc = { version = "0.1.21", default-features = false }
 yarte = { version = "0.12", features = ["bytes-buf", "json"] }
 env_logger = "0.7"
 random-fast-rng = "0.1.1"

+ 1 - 1
frameworks/Rust/ntex/ntex-db.dockerfile

@@ -1,4 +1,4 @@
-FROM rust:1.45
+FROM rust:1.46
 
 # Disable simd at jsonescape
 ENV CARGO_CFG_JSONESCAPE_DISABLE_AUTO_SIMD=

+ 1 - 1
frameworks/Rust/ntex/ntex-raw.dockerfile

@@ -1,4 +1,4 @@
-FROM rust:1.45
+FROM rust:1.46
 
 # Disable simd at jsonescape
 ENV CARGO_CFG_JSONESCAPE_DISABLE_AUTO_SIMD=

+ 1 - 1
frameworks/Rust/ntex/ntex.dockerfile

@@ -1,4 +1,4 @@
-FROM rust:1.45
+FROM rust:1.46
 
 # Disable simd at jsonescape
 ENV CARGO_CFG_JSONESCAPE_DISABLE_AUTO_SIMD=

+ 1 - 1
frameworks/Rust/ntex/src/main.rs

@@ -1,5 +1,5 @@
 #[global_allocator]
-static ALLOC: snmalloc_rs::SnMalloc = snmalloc_rs::SnMalloc;
+static GLOBAL: mimalloc::MiMalloc = mimalloc::MiMalloc;
 
 use bytes::{Bytes, BytesMut};
 use ntex::{http, web};

+ 1 - 1
frameworks/Rust/ntex/src/main_db.rs

@@ -1,5 +1,5 @@
 #[global_allocator]
-static ALLOC: snmalloc_rs::SnMalloc = snmalloc_rs::SnMalloc;
+static GLOBAL: mimalloc::MiMalloc = mimalloc::MiMalloc;
 
 use std::future::Future;
 use std::pin::Pin;

+ 2 - 2
frameworks/Rust/ntex/src/main_raw.rs

@@ -1,5 +1,5 @@
 #[global_allocator]
-static ALLOC: snmalloc_rs::SnMalloc = snmalloc_rs::SnMalloc;
+static GLOBAL: mimalloc::MiMalloc = mimalloc::MiMalloc;
 
 use std::future::Future;
 use std::io;
@@ -87,7 +87,7 @@ impl Future for App {
                 unsafe { this.write_buf.set_len(0) }
             } else if written > 0 {
                 this.write_pos = written;
-                return Poll::Pending
+                return Poll::Pending;
             }
         }