Skip to content

Commit 36da026

Browse files
gmorphemeclaude
andcommitted
Fix rustfmt formatting issues in heap.rs
Fix line spacing and formatting issues that caused CI build failure: - Normalize blank lines and spacing - Fix line breaks for long expressions - Ensure consistent code formatting All performance metrics functionality remains unchanged. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 86b4d87 commit 36da026

File tree

1 file changed

+13
-12
lines changed

1 file changed

+13
-12
lines changed

src/eval/memory/heap.rs

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1155,24 +1155,25 @@ impl Heap {
11551155
/// Get a snapshot of current GC performance metrics (calculates derived metrics on-demand)
11561156
pub fn gc_metrics(&self) -> GCMetrics {
11571157
let mut metrics = unsafe { (*self.gc_metrics.get()).clone() };
1158-
1158+
11591159
// Calculate derived metrics on-demand to avoid hot path overhead
11601160
let now = Instant::now();
1161-
metrics.performance_counters.heap_lifetime = now.duration_since(metrics.performance_counters.heap_created_at);
1162-
1161+
metrics.performance_counters.heap_lifetime =
1162+
now.duration_since(metrics.performance_counters.heap_created_at);
1163+
11631164
// Calculate allocation rates
11641165
let heap_lifetime_seconds = metrics.performance_counters.heap_lifetime.as_secs_f64();
11651166
if heap_lifetime_seconds > 0.0 {
1166-
metrics.allocation_stats.allocation_rate_bps =
1167+
metrics.allocation_stats.allocation_rate_bps =
11671168
metrics.allocation_stats.total_bytes_allocated as f64 / heap_lifetime_seconds;
1168-
metrics.allocation_stats.allocation_rate_ops =
1169+
metrics.allocation_stats.allocation_rate_ops =
11691170
metrics.allocation_stats.total_objects_allocated as f64 / heap_lifetime_seconds;
11701171
}
1171-
1172+
11721173
// Update utilisation and performance metrics
11731174
self.calculate_utilisation_metrics(&mut metrics);
11741175
self.calculate_performance_health(&mut metrics);
1175-
1176+
11761177
metrics
11771178
}
11781179

@@ -1203,7 +1204,7 @@ impl Heap {
12031204
}
12041205
}
12051206
}
1206-
1207+
12071208
// In release builds, do nothing to maximize performance
12081209
#[cfg(not(debug_assertions))]
12091210
{
@@ -1249,14 +1250,15 @@ impl Heap {
12491250
let total_time = now.duration_since(metrics.performance_counters.heap_created_at);
12501251
if total_time.as_secs_f64() > 0.0 {
12511252
metrics.performance_counters.gc_overhead_percent =
1252-
(metrics.collection_stats.total_gc_time.as_secs_f64() / total_time.as_secs_f64())
1253+
(metrics.collection_stats.total_gc_time.as_secs_f64()
1254+
/ total_time.as_secs_f64())
12531255
* 100.0;
12541256
}
12551257

12561258
// Reset allocation burst after collection
12571259
metrics.allocation_stats.current_burst_bytes = 0;
12581260
}
1259-
1261+
12601262
// In release builds, do nothing
12611263
#[cfg(not(debug_assertions))]
12621264
{
@@ -1306,7 +1308,7 @@ impl Heap {
13061308
total_bytes_freed / metrics.emergency_stats.successful_collections;
13071309
}
13081310
}
1309-
1311+
13101312
// In release builds, do nothing
13111313
#[cfg(not(debug_assertions))]
13121314
{
@@ -1368,7 +1370,6 @@ impl Heap {
13681370

13691371
/// Calculate performance health indicators on-demand
13701372
fn calculate_performance_health(&self, metrics: &mut GCMetrics) {
1371-
13721373
// Calculate memory pressure based on allocation rate and collection frequency
13731374
let allocation_pressure = if metrics.allocation_stats.peak_allocation_rate_bps > 0.0 {
13741375
(metrics.allocation_stats.allocation_rate_bps

0 commit comments

Comments
 (0)