Skip to main content

Module local

Module local 

Source
Expand description

A custom TLS implementation that allows for more than 5 entries in TLS.

FreeRTOS task locals have a hard limit of entries. The custom implementation used here stores a pointer to a custom TLS struct inside the first slot of FreeRTOS TLS. This sacrifices a bit of speed for the ability to have as many entries as memory allows.

LocalKeys can be created with the os_task_local! macro.

§Example

os_task_local! {
    static FOO: u32 = 0;
    static BAR: String = String::from("Hello, world!");
}

Structs§

LocalKey
A TLS key that owns its data. Can be created with the os_task_local macro.