File tree 6 files changed +22
-8
lines changed
6 files changed +22
-8
lines changed Original file line number Diff line number Diff line change 1
- #![ allow( dead_code) ]
2
-
3
1
use crate :: alloc:: { GlobalAlloc , Layout , System } ;
4
2
use crate :: cmp;
5
3
use 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 22
22
23
23
#![ allow( missing_debug_implementations) ]
24
24
25
+ mod common;
26
+
25
27
cfg_if:: cfg_if! {
26
28
if #[ cfg( target_os = "vxworks" ) ] {
27
29
mod vxworks;
Original file line number Diff line number Diff line change 1
1
use crate :: alloc:: { GlobalAlloc , Layout , System } ;
2
2
use crate :: ptr;
3
- use crate :: sys_common :: alloc:: { realloc_fallback, MIN_ALIGN } ;
3
+ use crate :: sys :: common :: alloc:: { realloc_fallback, MIN_ALIGN } ;
4
4
5
5
#[ stable( feature = "alloc_system_type" , since = "1.28.0" ) ]
6
6
unsafe impl GlobalAlloc for System {
Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ use crate::ffi::c_void;
5
5
use crate :: ptr;
6
6
use crate :: sync:: atomic:: { AtomicPtr , Ordering } ;
7
7
use crate :: sys:: c;
8
- use crate :: sys_common :: alloc:: { realloc_fallback, MIN_ALIGN } ;
8
+ use crate :: sys :: common :: alloc:: { realloc_fallback, MIN_ALIGN } ;
9
9
10
10
#[ cfg( test) ]
11
11
mod tests;
Original file line number Diff line number Diff line change 8
8
//! rest of `std` is complex, with dependencies going in all
9
9
//! directions: `std` depending on `sys_common`, `sys_common`
10
10
//! 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.
14
16
15
17
#![ allow( missing_docs) ]
16
18
#![ allow( missing_debug_implementations) ]
@@ -46,7 +48,6 @@ macro_rules! rtunwrap {
46
48
} ;
47
49
}
48
50
49
- pub mod alloc;
50
51
pub mod at_exit_imp;
51
52
pub mod backtrace;
52
53
pub mod bytestring;
You can’t perform that action at this time.
0 commit comments