mirror of
https://github.com/rust-lang/rust
synced 2024-10-03 07:14:34 +00:00
02134611ce
Make sure the implementation of TcpStream::as_raw_fd is fully inlined Currently the following function: ```rust use std::os::fd::{AsRawFd, RawFd}; use std::net::TcpStream; pub fn as_raw_fd(socket: &TcpStream) -> RawFd { socket.as_raw_fd() } ``` Is optimized to the following: ```asm example::as_raw_fd: push rax call qword ptr [rip + <std::net::tcp::TcpStream as std::sys_common::AsInner<std::sys_common::net::TcpStream>>::as_inner@GOTPCREL] mov rdi, rax call qword ptr [rip + std::sys_common::net::TcpStream::socket@GOTPCREL] mov rdi, rax pop rax jmp qword ptr [rip + _ZN73_$LT$std..sys..unix..net..Socket$u20$as$u20$std..os..fd..raw..AsRawFd$GT$9as_raw_fd17h633bcf7e481df8bbE@GOTPCREL] ``` I think it would make more sense to inline trivial functions used within `TcpStream::AsRawFd`. |
||
---|---|---|
.. | ||
alloc | ||
backtrace@8ad84ca5ad | ||
core | ||
panic_abort | ||
panic_unwind | ||
portable-simd | ||
proc_macro | ||
profiler_builtins | ||
rtstartup | ||
rustc-std-workspace-alloc | ||
rustc-std-workspace-core | ||
rustc-std-workspace-std | ||
std | ||
stdarch@b655243782 | ||
test | ||
unwind |