Files
regorus/bindings/ffi/Cargo.toml
Anand Krishnamoorthi 688e6128d4 feat: Detect incorrect multi-threaded use from c based ffi (#499)
Add runtime detection for shared handle misuse

wrap the FFI engine handle with parking_lot::RwLock when the new
contention_checks feature is enabled, surfacing a clear “handle is already
in use” error instead of allowing undefined behavior
keep the feature optional so no_std builds or environments that supply
their own synchronization can opt out
caution users that this guards the handle itself but does not make the
engine’s operations globally thread-safe on its own

Signed-off-by: Anand Krishnamoorthi <anakrish@microsoft.com>
2025-11-17 14:21:13 -06:00

37 lines
915 B
TOML

[workspace]
[package]
name = "regorus-ffi"
version = "0.5.0"
edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[lib]
crate-type = ["cdylib", "staticlib"]
[dependencies]
anyhow = "1.0"
regorus = { path = "../..", default-features = false }
serde_json = "1.0.140"
parking_lot = { version = "0.12", optional = true }
[profile.release]
# Enable full debug info for optimized builds.
debug = "full"
# Split debuginfo into its own file to reduce binary size.
split-debuginfo = "packed"
lto = true
codegen-units = 1
[features]
default = ["ast", "azure_policy", "std", "coverage", "regorus/arc", "regorus/full-opa", "contention_checks"]
ast = ["regorus/ast"]
azure_policy = ["regorus/azure_policy"]
std = ["regorus/std"]
coverage = ["regorus/coverage"]
contention_checks = ["parking_lot"]
custom_allocator = []
[build-dependencies]
cbindgen = "0.28.0"