Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/C/Firefox/third_party/rust/gpu-allocator/src/visualizer/   (Firefox Browser Version 136.0.1©)  Datei vom 10.2.2025 mit Größe 1 kB image not shown  

Quelle  mod.rs

  Sprache: Rust
 

use egui::{Color32, Ui};

mod allocation_reports;
mod memory_chunks;

pub(crateuse allocation_reports::*;
pub(crateuse memory_chunks::*;

use crate::allocator::AllocationType;

pub const DEFAULT_COLOR_ALLOCATION_TYPE_FREE: Color32 = Color32::from_rgb(159159159); // gray
pub const DEFAULT_COLOR_ALLOCATION_TYPE_LINEAR: Color32 = Color32::from_rgb(91206250); // blue
pub const DEFAULT_COLOR_ALLOCATION_TYPE_NON_LINEAR: Color32 = Color32::from_rgb(250169184); // pink

#[derive(Clone)]
pub struct ColorScheme {
    pub free_color: Color32,
    pub linear_color: Color32,
    pub non_linear_color: Color32,
}

impl Default for ColorScheme {
    fn default() -> Self {
        Self {
            free_color: DEFAULT_COLOR_ALLOCATION_TYPE_FREE,
            linear_color: DEFAULT_COLOR_ALLOCATION_TYPE_LINEAR,
            non_linear_color: DEFAULT_COLOR_ALLOCATION_TYPE_NON_LINEAR,
        }
    }
}

impl ColorScheme {
    pub(cratefn get_allocation_type_color(&self, allocation_type: AllocationType) -> Color32 {
        match allocation_type {
            AllocationType::Free => self.free_color,
            AllocationType::Linear => self.linear_color,
            AllocationType::NonLinear => self.non_linear_color,
        }
    }
}

pub(cratetrait SubAllocatorVisualizer {
    fn supports_visualization(&self) -> bool {
        false
    }
    fn draw_base_info(&self, ui: &mut Ui) {
        ui.label("No sub allocator information available");
    }
    fn draw_visualization(
        &self,
        _color_scheme: &ColorScheme,
        _ui: &mut Ui,
        _settings: &MemoryChunksVisualizationSettings,
    ) {
    }
}

Messung V0.5 in Prozent
C=89 H=97 G=93

¤ Dauer der Verarbeitung: 0.0 Sekunden  (vorverarbeitet am  2026-06-22) ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

PVS Prover

Isabelle Prover

NIST Cobol Testsuite

Cephes Mathematical Library

Vienna Development Method

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.