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.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more