mirror of
https://github.com/servo/servo.git
synced 2025-08-11 08:25:32 +01:00
Strict import formatting (grouping and granularity) (#30325)
* strict imports formatting * Reformat all imports
This commit is contained in:
parent
413da4ca69
commit
aad2dccc9c
802 changed files with 6861 additions and 6395 deletions
|
@ -4,18 +4,21 @@
|
|||
|
||||
//! Memory profiling functions.
|
||||
|
||||
use crate::time::duration_from_seconds;
|
||||
use ipc_channel::ipc::{self, IpcReceiver};
|
||||
use ipc_channel::router::ROUTER;
|
||||
use profile_traits::mem::ReportsChan;
|
||||
use profile_traits::mem::{ProfilerChan, ProfilerMsg, ReportKind, Reporter, ReporterRequest};
|
||||
use profile_traits::path;
|
||||
use std::borrow::ToOwned;
|
||||
use std::cmp::Ordering;
|
||||
use std::collections::HashMap;
|
||||
use std::thread;
|
||||
use std::time::Instant;
|
||||
|
||||
use ipc_channel::ipc::{self, IpcReceiver};
|
||||
use ipc_channel::router::ROUTER;
|
||||
use profile_traits::mem::{
|
||||
ProfilerChan, ProfilerMsg, ReportKind, Reporter, ReporterRequest, ReportsChan,
|
||||
};
|
||||
use profile_traits::path;
|
||||
|
||||
use crate::time::duration_from_seconds;
|
||||
|
||||
pub struct Profiler {
|
||||
/// The port through which messages are received.
|
||||
pub port: IpcReceiver<ProfilerMsg>,
|
||||
|
@ -384,22 +387,24 @@ impl ReportsForest {
|
|||
//---------------------------------------------------------------------------
|
||||
|
||||
mod system_reporter {
|
||||
use super::{JEMALLOC_HEAP_ALLOCATED_STR, SYSTEM_HEAP_ALLOCATED_STR};
|
||||
#[cfg(target_os = "linux")]
|
||||
use libc::c_int;
|
||||
#[cfg(not(target_os = "windows"))]
|
||||
use libc::{c_void, size_t};
|
||||
use profile_traits::mem::{Report, ReportKind, ReporterRequest};
|
||||
use profile_traits::path;
|
||||
#[cfg(not(target_os = "windows"))]
|
||||
use std::ffi::CString;
|
||||
#[cfg(not(target_os = "windows"))]
|
||||
use std::mem::size_of;
|
||||
#[cfg(not(target_os = "windows"))]
|
||||
use std::ptr::null_mut;
|
||||
|
||||
#[cfg(target_os = "linux")]
|
||||
use libc::c_int;
|
||||
#[cfg(not(target_os = "windows"))]
|
||||
use libc::{c_void, size_t};
|
||||
use profile_traits::mem::{Report, ReportKind, ReporterRequest};
|
||||
use profile_traits::path;
|
||||
#[cfg(target_os = "macos")]
|
||||
use task_info::task_basic_info::{resident_size, virtual_size};
|
||||
|
||||
use super::{JEMALLOC_HEAP_ALLOCATED_STR, SYSTEM_HEAP_ALLOCATED_STR};
|
||||
|
||||
/// Collects global measurements from the OS and heap allocators.
|
||||
pub fn collect_reports(request: ReporterRequest) {
|
||||
let mut reports = vec![];
|
||||
|
@ -599,12 +604,13 @@ mod system_reporter {
|
|||
|
||||
#[cfg(target_os = "linux")]
|
||||
fn resident_segments() -> Vec<(String, usize)> {
|
||||
use regex::Regex;
|
||||
use std::collections::hash_map::Entry;
|
||||
use std::collections::HashMap;
|
||||
use std::fs::File;
|
||||
use std::io::{BufRead, BufReader};
|
||||
|
||||
use regex::Regex;
|
||||
|
||||
// The first line of an entry in /proc/<pid>/smaps looks just like an entry
|
||||
// in /proc/<pid>/maps:
|
||||
//
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue