File tree Expand file tree Collapse file tree 6 files changed +22
-8
lines changed Expand file tree Collapse file tree 6 files changed +22
-8
lines changed Original file line number Diff line number Diff line change 1- #![ allow( dead_code) ]
2-
31use crate :: alloc:: { GlobalAlloc , Layout , System } ;
42use crate :: cmp;
53use crate :: ptr;
Original file line number Diff line number Diff line change 1+ // This module contains code that is shared between all platforms, mostly utility or fallback code.
2+ // This explicitly does not include code that is shared between only a few platforms,
3+ // such as when reusing an implementation from `unix` or `unsupported`.
4+ // In those cases the desired code should be included directly using the #[path] attribute,
5+ // not moved to this module.
6+ //
7+ // Currently `sys_common` contains a lot of code that should live in this module,
8+ // ideally `sys_common` would only contain platform-independent abstractions on top of `sys`.
9+ // Progress on this is tracked in #84187.
10+
11+ #![ allow( dead_code) ]
12+
13+ pub mod alloc;
Original file line number Diff line number Diff line change 2222
2323#![ allow( missing_debug_implementations) ]
2424
25+ mod common;
26+
2527cfg_if:: cfg_if! {
2628 if #[ cfg( target_os = "vxworks" ) ] {
2729 mod vxworks;
Original file line number Diff line number Diff line change 11use crate :: alloc:: { GlobalAlloc , Layout , System } ;
22use crate :: ptr;
3- use crate :: sys_common :: alloc:: { realloc_fallback, MIN_ALIGN } ;
3+ use crate :: sys :: common :: alloc:: { realloc_fallback, MIN_ALIGN } ;
44
55#[ stable( feature = "alloc_system_type" , since = "1.28.0" ) ]
66unsafe impl GlobalAlloc for System {
Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ use crate::ffi::c_void;
55use crate :: ptr;
66use crate :: sync:: atomic:: { AtomicPtr , Ordering } ;
77use crate :: sys:: c;
8- use crate :: sys_common :: alloc:: { realloc_fallback, MIN_ALIGN } ;
8+ use crate :: sys :: common :: alloc:: { realloc_fallback, MIN_ALIGN } ;
99
1010#[ cfg( test) ]
1111mod tests;
Original file line number Diff line number Diff line change 88//! rest of `std` is complex, with dependencies going in all
99//! directions: `std` depending on `sys_common`, `sys_common`
1010//! depending on `sys`, and `sys` depending on `sys_common` and `std`.
11- //! Ideally `sys_common` would be split into two and the dependencies
12- //! between them all would form a dag, facilitating the extraction of
13- //! `std::sys` from the standard library.
11+ //! This is because `sys_common` not only contains platform-independent code,
12+ //! but also code that is shared between the different platforms in `sys`.
13+ //! Ideally all that shared code should be moved to `sys::common`,
14+ //! and the dependencies between `std`, `sys_common` and `sys` all would form a dag.
15+ //! Progress on this is tracked in #84187.
1416
1517#![ allow( missing_docs) ]
1618#![ allow( missing_debug_implementations) ]
@@ -46,7 +48,6 @@ macro_rules! rtunwrap {
4648 } ;
4749}
4850
49- pub mod alloc;
5051pub mod at_exit_imp;
5152pub mod backtrace;
5253pub mod bytestring;
You can’t perform that action at this time.
0 commit comments