add hardened_malloc-rs feature and global_allocator

Signed-off-by: strawberry <strawberry@pupbrain.dev>
This commit is contained in:
strawberry 2024-04-10 01:53:31 -04:00 committed by June
parent 7d92cad55f
commit ff0d4c98ee
4 changed files with 22 additions and 4 deletions

View file

@ -46,6 +46,13 @@ mod routes;
#[global_allocator]
static GLOBAL: Jemalloc = Jemalloc;
#[cfg(all(not(target_env = "msvc"), not(target_os = "macos"), feature = "hardened_malloc", target_os = "linux"))]
use hardened_malloc_rs::HardenedMalloc;
#[cfg(all(not(target_env = "msvc"), not(target_os = "macos"), feature = "hardened_malloc", target_os = "linux"))]
#[global_allocator]
static GLOBAL: HardenedMalloc = HardenedMalloc;
struct Server {
config: Config,