pub enum ThreadLocalMode {
NotThreadLocal,
GeneralDynamicTLSModel,
LocalDynamicTLSModel,
InitialExecTLSModel,
LocalExecTLSModel,
}
Expand description
Represents the thread-local storage (TLS) model for a global variable in LLVM.
Thread-local storage allows each thread to have its own instance of a global variable. The different TLS models dictate how the runtime handles accessing the variable across threads and whether the variable is accessed dynamically or statically.
Variants§
NotThreadLocal
The global variable is not thread-local.
GeneralDynamicTLSModel
General dynamic TLS model, suitable for global variables that are accessed across multiple modules and can be dynamically allocated for each thread.
LocalDynamicTLSModel
Local dynamic TLS model, suitable for global variables that are dynamically allocated but only accessed within the same module.
InitialExecTLSModel
Initial execution TLS model, allowing for faster access to TLS variables when they are known to be used early during program execution (such as in dynamic libraries).
LocalExecTLSModel
Local execution TLS model, providing fast access to thread-local variables that are only accessed within the current module, without requiring relocation.
Trait Implementations§
source§impl Clone for ThreadLocalMode
impl Clone for ThreadLocalMode
source§fn clone(&self) -> ThreadLocalMode
fn clone(&self) -> ThreadLocalMode
1.6.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for ThreadLocalMode
impl Debug for ThreadLocalMode
source§impl From<LLVMThreadLocalMode> for ThreadLocalMode
impl From<LLVMThreadLocalMode> for ThreadLocalMode
source§fn from(mode: LLVMThreadLocalMode) -> Self
fn from(mode: LLVMThreadLocalMode) -> Self
source§impl From<ThreadLocalMode> for LLVMThreadLocalMode
impl From<ThreadLocalMode> for LLVMThreadLocalMode
source§fn from(mode: ThreadLocalMode) -> Self
fn from(mode: ThreadLocalMode) -> Self
source§impl PartialEq for ThreadLocalMode
impl PartialEq for ThreadLocalMode
impl Copy for ThreadLocalMode
impl Eq for ThreadLocalMode
impl StructuralPartialEq for ThreadLocalMode
Auto Trait Implementations§
impl Freeze for ThreadLocalMode
impl RefUnwindSafe for ThreadLocalMode
impl Send for ThreadLocalMode
impl Sync for ThreadLocalMode
impl Unpin for ThreadLocalMode
impl UnwindSafe for ThreadLocalMode
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)