Implement TLS scoped keys, compiler builtins
This commit is contained in:
parent
37bfef023d
commit
4edcddfb61
2 changed files with 3 additions and 3 deletions
|
|
@ -17,10 +17,10 @@ pub type Key = usize;
|
|||
|
||||
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>)> {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue