add hardened_malloc-rs feature and global_allocator
Signed-off-by: strawberry <strawberry@pupbrain.dev>
This commit is contained in:
parent
7d92cad55f
commit
ff0d4c98ee
4 changed files with 22 additions and 4 deletions
8
.vscode/launch.json
vendored
8
.vscode/launch.json
vendored
|
@ -23,11 +23,11 @@
|
||||||
"args": [],
|
"args": [],
|
||||||
"env": {
|
"env": {
|
||||||
"RUST_BACKTRACE": "1",
|
"RUST_BACKTRACE": "1",
|
||||||
"CONDUIT_CONFIG": "",
|
"CONDUIT_DATABASE_PATH": "/tmp/awawawa",
|
||||||
"CONDUIT_SERVER_NAME": "localhost",
|
|
||||||
"CONDUIT_DATABASE_PATH": "/tmp",
|
|
||||||
"CONDUIT_ADDRESS": "0.0.0.0",
|
"CONDUIT_ADDRESS": "0.0.0.0",
|
||||||
"CONDUIT_PORT": "6167"
|
"CONDUIT_PORT": "55551",
|
||||||
|
"CONDUIT_SERVER_NAME": "your.server.name",
|
||||||
|
"CONDUIT_LOG": "debug"
|
||||||
},
|
},
|
||||||
"cwd": "${workspaceFolder}"
|
"cwd": "${workspaceFolder}"
|
||||||
}
|
}
|
||||||
|
|
5
Cargo.lock
generated
5
Cargo.lock
generated
|
@ -474,6 +474,7 @@ dependencies = [
|
||||||
"either",
|
"either",
|
||||||
"figment",
|
"figment",
|
||||||
"futures-util",
|
"futures-util",
|
||||||
|
"hardened_malloc-rs",
|
||||||
"hickory-resolver",
|
"hickory-resolver",
|
||||||
"hmac",
|
"hmac",
|
||||||
"http 0.2.12",
|
"http 0.2.12",
|
||||||
|
@ -966,6 +967,10 @@ dependencies = [
|
||||||
"tracing",
|
"tracing",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "hardened_malloc-rs"
|
||||||
|
version = "0.1.0+12"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "hashbrown"
|
name = "hashbrown"
|
||||||
version = "0.14.3"
|
version = "0.14.3"
|
||||||
|
|
|
@ -308,6 +308,10 @@ hyperlocal = { git = "https://github.com/softprops/hyperlocal", rev = "2ee4d1496
|
||||||
"server",
|
"server",
|
||||||
] } # unix socket support
|
] } # unix socket support
|
||||||
|
|
||||||
|
[target.'cfg(all(not(target_env = "msvc"), not(target_os = "macos"), target_os = "linux"))'.dependencies]
|
||||||
|
hardened_malloc-rs = { optional = true, features = ["static", "clang", "light"], path = "../hardened_malloc-rs", default-features = false }
|
||||||
|
#hardened_malloc-rs = { version = "0.1", optional = true, features = ["static", "clang", "light"], default-features = false }
|
||||||
|
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
default = [
|
default = [
|
||||||
|
@ -343,6 +347,8 @@ perf_measurements = [
|
||||||
"opentelemetry-jaeger",
|
"opentelemetry-jaeger",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
hardened_malloc = ["hardened_malloc-rs"]
|
||||||
|
|
||||||
# client/server interopability hacks
|
# client/server interopability hacks
|
||||||
#
|
#
|
||||||
## element has various non-spec compliant behaviour
|
## element has various non-spec compliant behaviour
|
||||||
|
|
|
@ -46,6 +46,13 @@ mod routes;
|
||||||
#[global_allocator]
|
#[global_allocator]
|
||||||
static GLOBAL: Jemalloc = Jemalloc;
|
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 {
|
struct Server {
|
||||||
config: Config,
|
config: Config,
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue