Skip to content

Commit

Permalink
Fixup
Browse files Browse the repository at this point in the history
  • Loading branch information
carllin committed Feb 23, 2021
1 parent 18ce530 commit f3ac9af
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions perf/src/recycler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -120,15 +120,13 @@ impl<T: Default + Reset> ObjectPool<T> {
recycler_name: &'static str,
) -> Option<(RecyclerShrinkStats, Vec<T>)> {
let is_consistent = self.total_allocated_count as usize >= self.len();
if !is_consistent {
warn!(
"Object pool inconsistent: {} {} {}",
self.total_allocated_count,
self.len(),
recycler_name
);
}
assert!(is_consistent);
assert!(
is_consistent,
"Object pool inconsistent: {} {} {}",
self.total_allocated_count,
self.len(),
recycler_name
);
if self.last_shrink_check_time.elapsed().as_millis() > self.check_shrink_interval_ms as u128
{
self.last_shrink_check_time = Instant::now();
Expand Down

0 comments on commit f3ac9af

Please sign in to comment.