Spaces:
Runtime error
Runtime error
neon_arch
commited on
Commit
•
028463b
1
Parent(s):
fceacdb
⚙️ refactor: replace jemalloc with mimalloc (#178)(#180)
Browse files- src/bin/websurfx.rs +5 -0
src/bin/websurfx.rs
CHANGED
@@ -3,6 +3,7 @@
|
|
3 |
//! This module contains the main function which handles the logging of the application to the
|
4 |
//! stdout and handles the command line arguments provided and launches the `websurfx` server.
|
5 |
|
|
|
6 |
use std::net::TcpListener;
|
7 |
use websurfx::{config::parser::Config, run};
|
8 |
|
@@ -11,6 +12,10 @@ use websurfx::{config::parser::Config, run};
|
|
11 |
#[global_allocator]
|
12 |
static ALLOC: dhat::Alloc = dhat::Alloc;
|
13 |
|
|
|
|
|
|
|
|
|
14 |
/// The function that launches the main server and registers all the routes of the website.
|
15 |
///
|
16 |
/// # Error
|
|
|
3 |
//! This module contains the main function which handles the logging of the application to the
|
4 |
//! stdout and handles the command line arguments provided and launches the `websurfx` server.
|
5 |
|
6 |
+
use mimalloc::MiMalloc;
|
7 |
use std::net::TcpListener;
|
8 |
use websurfx::{config::parser::Config, run};
|
9 |
|
|
|
12 |
#[global_allocator]
|
13 |
static ALLOC: dhat::Alloc = dhat::Alloc;
|
14 |
|
15 |
+
#[cfg(not(feature = "dhat-heap"))]
|
16 |
+
#[global_allocator]
|
17 |
+
static GLOBAL: MiMalloc = MiMalloc;
|
18 |
+
|
19 |
/// The function that launches the main server and registers all the routes of the website.
|
20 |
///
|
21 |
/// # Error
|