Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions crates/victory-gpu/src/copystat.rs
Original file line number Diff line number Diff line change
Expand Up @@ -381,6 +381,7 @@ fn big_blocks() -> String {

/// The system's allocator with every block counted in [`OWN`] (two atomic
/// additions per allocation and per release: diagnostics builds only).
#[allow(dead_code)]
struct Counting;

// SAFETY: every call goes to the system's allocator unchanged; only
Expand Down Expand Up @@ -426,6 +427,9 @@ unsafe impl std::alloc::GlobalAlloc for Counting {
}
}

// Only in diagnostics builds, as the doc above states: every allocation and
// release in the process otherwise pays for the counters.
#[cfg(feature = "diagnostics")]
#[global_allocator]
static HEAP: Counting = Counting;

Expand Down