Implement TLS scoped keys, compiler builtins

This commit is contained in:
Jeremy Soller 2016-10-30 16:14:47 -06:00
parent 37bfef023d
commit 4edcddfb61
2 changed files with 3 additions and 3 deletions

View File

@ -322,7 +322,7 @@
extern crate alloc_system;
// 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
#[cfg(test)] extern crate std as realstd;

View File

@ -17,10 +17,10 @@
type Dtor = unsafe extern fn(*mut u8);
//TODO: Implement this properly
#[thread_local]
static mut NEXT_KEY: Key = 0;
#[thread_local]
static mut LOCALS: *mut BTreeMap<Key, (*mut u8, Option<Dtor>)> = ptr::null_mut();
unsafe fn locals() -> &'static mut BTreeMap<Key, (*mut u8, Option<Dtor>)> {