Volatile¶
| Spice | |
|---|---|
Functions¶
volatileLoad¶
| Spice | |
|---|---|
Read the value behind the given pointer with a volatile load. The optimizer never elides, duplicates or reorders it against other volatile accesses, e.g. for reading memory-mapped I/O registers. Note: This is no synchronization primitive. Use std/os/atomic or std/os/mutex for sharing data between threads.
Parameters
| Name | Type | Description |
|---|---|---|
ptr |
const T* |
Pointer to a value of primitive, enum or pointer type |
Returns: T — Loaded value
volatileStore¶
| Spice | |
|---|---|
Write the given value to the given pointer with a volatile store. The optimizer never elides, duplicates or reorders it against other volatile accesses, e.g. for writing memory-mapped I/O registers. Note: This is no synchronization primitive. Use std/os/atomic or std/os/mutex for sharing data between threads.
Parameters
| Name | Type | Description |
|---|---|---|
ptr |
T* |
Pointer to a value of primitive, enum or pointer type |
value |
T |
Value to store |