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;
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>)> {