0
0
mirror of https://github.com/neon-mmd/websurfx.git synced 2024-12-22 20:38:22 -05:00

⚙️ refactor: add dhat profiler configuration with feat flag (#180)(#178)

This commit is contained in:
neon_arch 2023-08-27 20:46:19 +03:00
parent 7a8bf022d4
commit 4afc0d16f0

View File

@ -6,6 +6,11 @@
use std::net::TcpListener;
use websurfx::{config::parser::Config, run};
/// A dhat heap memory profiler
#[cfg(feature = "dhat-heap")]
#[global_allocator]
static ALLOC: dhat::Alloc = dhat::Alloc;
/// The function that launches the main server and registers all the routes of the website.
///
/// # Error
@ -14,6 +19,10 @@ use websurfx::{config::parser::Config, run};
/// available for being used for other applications.
#[actix_web::main]
async fn main() -> std::io::Result<()> {
// A dhat heap profiler initialization.
#[cfg(feature = "dhat-heap")]
let _profiler = dhat::Profiler::new_heap();
// Initialize the parsed config file.
let config = Config::parse(false).unwrap();