pub enum TlsModel {
GlobalDynamic,
LocalDynamic,
InitialExec,
LocalExec,
}Expand description
How a thread-local variable is reached.
The models are ordered from the most general to the fastest, and a model may always be
replaced by a more general one. The frontend picks from the storage class and the
visibility, -ftls-model= overrides it, and the linker may relax a general one into a
faster one when it turns out the definition is in the executable.
Variants§
GlobalDynamic
Works for any variable in any object, at the cost of a call to __tls_get_addr.
LocalDynamic
One call to __tls_get_addr for several variables that are known to share a module.
InitialExec
The offset is loaded from the GOT. Needs the variable to be in a module loaded at
program start rather than by dlopen.
LocalExec
The offset is a link-time constant. Only for a variable in the executable itself.
Implementations§
Trait Implementations§
impl Copy for TlsModel
impl Eq for TlsModel
Source§impl Ord for TlsModel
impl Ord for TlsModel
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
Source§impl PartialOrd for TlsModel
impl PartialOrd for TlsModel
impl StructuralPartialEq for TlsModel
Auto Trait Implementations§
impl Freeze for TlsModel
impl RefUnwindSafe for TlsModel
impl Send for TlsModel
impl Sync for TlsModel
impl Unpin for TlsModel
impl UnsafeUnpin for TlsModel
impl UnwindSafe for TlsModel
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
Mutably borrows from an owned value. Read more