diff --git a/ipa-core/benches/oneshot/ipa.rs b/ipa-core/benches/oneshot/ipa.rs index 5fd4ba52c..cb2d963d2 100644 --- a/ipa-core/benches/oneshot/ipa.rs +++ b/ipa-core/benches/oneshot/ipa.rs @@ -14,7 +14,6 @@ use ipa_core::{ ipa::{ipa_in_the_clear, test_oprf_ipa, CappingOrder, IpaSecurityModel}, EventGenerator, EventGeneratorConfig, TestWorld, TestWorldConfig, }, - use_jemalloc, }; use ipa_step::StepNarrow; use rand::{random, rngs::StdRng, SeedableRng}; @@ -159,7 +158,7 @@ async fn run(args: Args) -> Result<(), Error> { fn main() -> Result<(), Error> { #[cfg(jemalloc)] - use_jemalloc!(); + ipa_core::use_jemalloc!(); #[cfg(feature = "dhat-heap")] #[global_allocator] diff --git a/ipa-core/src/bin/helper.rs b/ipa-core/src/bin/helper.rs index 28ad19d1b..3b62653a4 100644 --- a/ipa-core/src/bin/helper.rs +++ b/ipa-core/src/bin/helper.rs @@ -25,7 +25,7 @@ use ipa_core::{ ShardHttpTransport, }, sharding::ShardIndex, - use_jemalloc, AppConfig, AppSetup, NonZeroU32PowerOfTwo, + AppConfig, AppSetup, NonZeroU32PowerOfTwo, }; use tokio::runtime::Runtime; use tracing::{error, info}; @@ -362,7 +362,7 @@ fn new_query_runtime(logging_handle: &LoggingHandle) -> Runtime { #[tokio::main(flavor = "current_thread")] pub async fn main() { #[cfg(jemalloc)] - use_jemalloc!(); + ipa_core::use_jemalloc!(); #[cfg(feature = "dhat-heap")] #[global_allocator] diff --git a/ipa-core/src/telemetry/memory.rs b/ipa-core/src/telemetry/memory.rs index 8db372275..d43e791f1 100644 --- a/ipa-core/src/telemetry/memory.rs +++ b/ipa-core/src/telemetry/memory.rs @@ -26,6 +26,9 @@ pub mod jemalloc { static CONTROLS: RwLock> = RwLock::new(None); /// Activates periodic memory usage reporting during `seq_join`. + /// + /// # Panics + /// If `RwLock` is poisoned. pub fn activate() { let mut controls = CONTROLS.write().unwrap(); @@ -59,6 +62,9 @@ pub mod jemalloc { /// As `count` increases, so does the report interval. This results in /// a tolerable amount of log messages for loops with many iterations, /// while still providing some reporting for shorter loops. + /// + /// # Panics + /// If `RwLock` is poisoned. pub fn periodic_memory_report(count: usize) { let controls_opt = CONTROLS.read().unwrap(); if let Some(controls) = controls_opt.as_ref() {