Implement TLS scoped keys, compiler builtins
This commit is contained in:
parent
37bfef023d
commit
4edcddfb61
@ -322,7 +322,7 @@
|
|||||||
extern crate alloc_system;
|
extern crate alloc_system;
|
||||||
|
|
||||||
// compiler-rt intrinsics
|
// compiler-rt intrinsics
|
||||||
//REDOX TODO extern crate compiler_builtins;
|
extern crate compiler_builtins;
|
||||||
|
|
||||||
// Make std testable by not duplicating lang items and other globals. See #2912
|
// Make std testable by not duplicating lang items and other globals. See #2912
|
||||||
#[cfg(test)] extern crate std as realstd;
|
#[cfg(test)] extern crate std as realstd;
|
||||||
|
@ -17,10 +17,10 @@
|
|||||||
|
|
||||||
type Dtor = unsafe extern fn(*mut u8);
|
type Dtor = unsafe extern fn(*mut u8);
|
||||||
|
|
||||||
//TODO: Implement this properly
|
#[thread_local]
|
||||||
|
|
||||||
static mut NEXT_KEY: Key = 0;
|
static mut NEXT_KEY: Key = 0;
|
||||||
|
|
||||||
|
#[thread_local]
|
||||||
static mut LOCALS: *mut BTreeMap<Key, (*mut u8, Option<Dtor>)> = ptr::null_mut();
|
static mut LOCALS: *mut BTreeMap<Key, (*mut u8, Option<Dtor>)> = ptr::null_mut();
|
||||||
|
|
||||||
unsafe fn locals() -> &'static mut BTreeMap<Key, (*mut u8, Option<Dtor>)> {
|
unsafe fn locals() -> &'static mut BTreeMap<Key, (*mut u8, Option<Dtor>)> {
|
||||||
|
Loading…
Reference in New Issue
Block a user