File tree 5 files changed +14
-6
lines changed
5 files changed +14
-6
lines changed Original file line number Diff line number Diff line change @@ -10,8 +10,10 @@ use crate::sys::pal::waitqueue::SpinMutex;
10
10
// The current allocator here is the `dlmalloc` crate which we've got included
11
11
// in the rust-lang/rust repository as a submodule. The crate is a port of
12
12
// dlmalloc.c from C to Rust.
13
+ //
14
+ // Specifying linkage/symbol name is solely to ensure a single instance between this crate and its unit tests
13
15
#[ cfg_attr( test, linkage = "available_externally" ) ]
14
- #[ unsafe( export_name = "_ZN16__rust_internals3std3sys3sgx5alloc8DLMALLOCE " ) ]
16
+ #[ unsafe( export_name = "_ZN16__rust_internals3std3sys5alloc3sgx8DLMALLOCE " ) ]
15
17
static DLMALLOC : SpinMutex < dlmalloc:: Dlmalloc < Sgx > > =
16
18
SpinMutex :: new ( dlmalloc:: Dlmalloc :: new_with_allocator ( Sgx { } ) ) ;
17
19
Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ use crate::sys::pal::abi::usercalls::raw::ByteBuffer;
8
8
use crate :: sys_common:: FromInner ;
9
9
use crate :: { fmt, slice} ;
10
10
11
+ // Specifying linkage/symbol name is solely to ensure a single instance between this crate and its unit tests
11
12
#[ cfg_attr( test, linkage = "available_externally" ) ]
12
13
#[ unsafe( export_name = "_ZN16__rust_internals3std3sys3sgx4args4ARGSE" ) ]
13
14
static ARGS : AtomicUsize = AtomicUsize :: new ( 0 ) ;
Original file line number Diff line number Diff line change @@ -11,15 +11,17 @@ const USIZE_BITS: usize = 64;
11
11
const TLS_KEYS : usize = 128 ; // Same as POSIX minimum
12
12
const TLS_KEYS_BITSET_SIZE : usize = ( TLS_KEYS + ( USIZE_BITS - 1 ) ) / USIZE_BITS ;
13
13
14
+ // Specifying linkage/symbol name is solely to ensure a single instance between this crate and its unit tests
14
15
#[ cfg_attr( test, linkage = "available_externally" ) ]
15
- #[ unsafe( export_name = "_ZN16__rust_internals3std3sys3sgx3abi3tls14TLS_KEY_IN_USEE " ) ]
16
+ #[ unsafe( export_name = "_ZN16__rust_internals3std3sys3pal3sgx3abi3tls14TLS_KEY_IN_USEE " ) ]
16
17
static TLS_KEY_IN_USE : SyncBitset = SYNC_BITSET_INIT ;
17
18
macro_rules! dup {
18
19
( ( * $( $exp: tt) * ) $( $val: tt) * ) => ( dup!( ( $( $exp) * ) $( $val) * $( $val) * ) ) ;
19
20
( ( ) $( $val: tt) * ) => ( [ $( $val) ,* ] )
20
21
}
22
+ // Specifying linkage/symbol name is solely to ensure a single instance between this crate and its unit tests
21
23
#[ cfg_attr( test, linkage = "available_externally" ) ]
22
- #[ unsafe( export_name = "_ZN16__rust_internals3std3sys3sgx3abi3tls14TLS_DESTRUCTORE " ) ]
24
+ #[ unsafe( export_name = "_ZN16__rust_internals3std3sys3pal3sgx3abi3tls14TLS_DESTRUCTORE " ) ]
23
25
static TLS_DESTRUCTOR : [ AtomicUsize ; TLS_KEYS ] = dup ! ( ( * * * * * * * ) ( AtomicUsize :: new( 0 ) ) ) ;
24
26
25
27
unsafe extern "C" {
Original file line number Diff line number Diff line change @@ -73,11 +73,13 @@ pub fn current_exe() -> io::Result<PathBuf> {
73
73
unsupported ( )
74
74
}
75
75
76
+ // Specifying linkage/symbol name is solely to ensure a single instance between this crate and its unit tests
76
77
#[ cfg_attr( test, linkage = "available_externally" ) ]
77
- #[ unsafe( export_name = "_ZN16__rust_internals3std3sys3sgx2os3ENVE " ) ]
78
+ #[ unsafe( export_name = "_ZN16__rust_internals3std3sys3pal3sgx2os3ENVE " ) ]
78
79
static ENV : AtomicUsize = AtomicUsize :: new ( 0 ) ;
80
+ // Specifying linkage/symbol name is solely to ensure a single instance between this crate and its unit tests
79
81
#[ cfg_attr( test, linkage = "available_externally" ) ]
80
- #[ unsafe( export_name = "_ZN16__rust_internals3std3sys3sgx2os8ENV_INITE " ) ]
82
+ #[ unsafe( export_name = "_ZN16__rust_internals3std3sys3pal3sgx2os8ENV_INITE " ) ]
81
83
static ENV_INIT : Once = Once :: new ( ) ;
82
84
type EnvStore = Mutex < HashMap < OsString , OsString > > ;
83
85
Original file line number Diff line number Diff line change @@ -45,8 +45,9 @@ mod task_queue {
45
45
}
46
46
}
47
47
48
+ // Specifying linkage/symbol name is solely to ensure a single instance between this crate and its unit tests
48
49
#[ cfg_attr( test, linkage = "available_externally" ) ]
49
- #[ unsafe( export_name = "_ZN16__rust_internals3std3sys3sgx6thread10TASK_QUEUEE " ) ]
50
+ #[ unsafe( export_name = "_ZN16__rust_internals3std3sys3pal3sgx6thread10TASK_QUEUEE " ) ]
50
51
static TASK_QUEUE : Mutex < Vec < Task > > = Mutex :: new ( Vec :: new ( ) ) ;
51
52
52
53
pub ( super ) fn lock ( ) -> MutexGuard < ' static , Vec < Task > > {
You can’t perform that action at this time.
0 commit comments