Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit b880760

Browse files
committedFeb 23, 2025
Auto merge of #137237 - cuviper:stage0, r=Mark-Simulacrum
Master bootstrap update https://forge.rust-lang.org/release/process.html#master-bootstrap-update-tuesday r? `@Mark-Simulacrum`
2 parents 1805b33 + e61cac2 commit b880760

File tree

47 files changed

+543
-1102
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+543
-1102
lines changed
 

‎compiler/rustc_data_structures/src/flock.rs

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -4,31 +4,6 @@
44
//! green/native threading. This is just a bare-bones enough solution for
55
//! librustdoc, it is not production quality at all.
66
7-
#[cfg(bootstrap)]
8-
cfg_match! {
9-
cfg(target_os = "linux") => {
10-
mod linux;
11-
use linux as imp;
12-
}
13-
cfg(target_os = "redox") => {
14-
mod linux;
15-
use linux as imp;
16-
}
17-
cfg(unix) => {
18-
mod unix;
19-
use unix as imp;
20-
}
21-
cfg(windows) => {
22-
mod windows;
23-
use self::windows as imp;
24-
}
25-
_ => {
26-
mod unsupported;
27-
use unsupported as imp;
28-
}
29-
}
30-
31-
#[cfg(not(bootstrap))]
327
cfg_match! {
338
target_os = "linux" => {
349
mod linux;

‎compiler/rustc_data_structures/src/profiling.rs

Lines changed: 0 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -860,69 +860,6 @@ fn get_thread_id() -> u32 {
860860
}
861861

862862
// Memory reporting
863-
#[cfg(bootstrap)]
864-
cfg_match! {
865-
cfg(windows) => {
866-
pub fn get_resident_set_size() -> Option<usize> {
867-
use std::mem;
868-
869-
use windows::{
870-
Win32::System::ProcessStatus::{K32GetProcessMemoryInfo, PROCESS_MEMORY_COUNTERS},
871-
Win32::System::Threading::GetCurrentProcess,
872-
};
873-
874-
let mut pmc = PROCESS_MEMORY_COUNTERS::default();
875-
let pmc_size = mem::size_of_val(&pmc);
876-
unsafe {
877-
K32GetProcessMemoryInfo(
878-
GetCurrentProcess(),
879-
&mut pmc,
880-
pmc_size as u32,
881-
)
882-
}
883-
.ok()
884-
.ok()?;
885-
886-
Some(pmc.WorkingSetSize)
887-
}
888-
}
889-
cfg(target_os = "macos") => {
890-
pub fn get_resident_set_size() -> Option<usize> {
891-
use libc::{c_int, c_void, getpid, proc_pidinfo, proc_taskinfo, PROC_PIDTASKINFO};
892-
use std::mem;
893-
const PROC_TASKINFO_SIZE: c_int = mem::size_of::<proc_taskinfo>() as c_int;
894-
895-
unsafe {
896-
let mut info: proc_taskinfo = mem::zeroed();
897-
let info_ptr = &mut info as *mut proc_taskinfo as *mut c_void;
898-
let pid = getpid() as c_int;
899-
let ret = proc_pidinfo(pid, PROC_PIDTASKINFO, 0, info_ptr, PROC_TASKINFO_SIZE);
900-
if ret == PROC_TASKINFO_SIZE {
901-
Some(info.pti_resident_size as usize)
902-
} else {
903-
None
904-
}
905-
}
906-
}
907-
}
908-
cfg(unix) => {
909-
pub fn get_resident_set_size() -> Option<usize> {
910-
let field = 1;
911-
let contents = fs::read("/proc/self/statm").ok()?;
912-
let contents = String::from_utf8(contents).ok()?;
913-
let s = contents.split_whitespace().nth(field)?;
914-
let npages = s.parse::<usize>().ok()?;
915-
Some(npages * 4096)
916-
}
917-
}
918-
_ => {
919-
pub fn get_resident_set_size() -> Option<usize> {
920-
None
921-
}
922-
}
923-
}
924-
925-
#[cfg(not(bootstrap))]
926863
cfg_match! {
927864
windows => {
928865
pub fn get_resident_set_size() -> Option<usize> {

0 commit comments

Comments
 (0)
Please sign in to comment.