-
Notifications
You must be signed in to change notification settings - Fork 13
Atomic operations
This category contains functions for handling atomic operations, such as Add, Compare And/Or Exchange, Fences, Loads/Stores, etc. More...
| Type | Name |
|---|---|
| fpl_common_api void * |
fplAtomicAddAndFetchPtr (volatile void **dest, const intptr_t addend) Adds the addend to destination pointer atomically and returns the result after the addition. |
| fpl_platform_api int32_t |
fplAtomicAddAndFetchS32 (volatile int32_t *dest, const int32_t addend) Adds the addend to destination 32-bit signed integer atomically and returns the result after the addition. |
| fpl_platform_api int64_t |
fplAtomicAddAndFetchS64 (volatile int64_t *dest, const int64_t addend) Adds the addend to destination 64-bit signed integer atomically and returns the result after the addition. |
| fpl_common_api size_t |
fplAtomicAddAndFetchSize (volatile size_t *dest, const size_t addend) Adds the addend to destination size atomically and returns the result after the addition. |
| fpl_platform_api uint32_t |
fplAtomicAddAndFetchU32 (volatile uint32_t *dest, const uint32_t addend) Adds the addend to destination 32-bit unsigned integer atomically and returns the result after the addition. |
| fpl_platform_api uint64_t |
fplAtomicAddAndFetchU64 (volatile uint64_t *dest, const uint64_t addend) Adds the addend to destination 64-bit unsigned integer atomically and returns the result after the addition. |
| fpl_common_api void * |
fplAtomicCompareAndSwapPtr (volatile void **dest, const void *comparand, const void *exchange) Compares a pointer with a comparand and swaps it when comparand matches the destination. |
| fpl_platform_api int32_t |
fplAtomicCompareAndSwapS32 (volatile int32_t *dest, const int32_t comparand, const int32_t exchange) Compares a 32-bit signed integer with a comparand and swaps it when comparand matches the destination. |
| fpl_platform_api int64_t |
fplAtomicCompareAndSwapS64 (volatile int64_t *dest, const int64_t comparand, const int64_t exchange) Compares a 64-bit signed integer with a comparand and swaps it when comparand matches the destination. |
| fpl_common_api size_t |
fplAtomicCompareAndSwapSize (volatile size_t *dest, const size_t comparand, const size_t exchange) Compares a size with a comparand and swaps it when comparand matches the destination. |
| fpl_platform_api uint32_t |
fplAtomicCompareAndSwapU32 (volatile uint32_t *dest, const uint32_t comparand, const uint32_t exchange) Compares a 32-bit unsigned integer with a comparand and swaps it when comparand matches the destination. |
| fpl_platform_api uint64_t |
fplAtomicCompareAndSwapU64 (volatile uint64_t *dest, const uint64_t comparand, const uint64_t exchange) Compares a 64-bit unsigned integer with a comparand and swaps it when comparand matches the destination. |
| fpl_common_api void * |
fplAtomicExchangePtr (volatile void **target, const void *value) Replaces a pointer with the given value atomically. |
| fpl_platform_api int32_t |
fplAtomicExchangeS32 (volatile int32_t *target, const int32_t value) Replaces a 32-bit signed integer with the given value atomically. |
| fpl_platform_api int64_t |
fplAtomicExchangeS64 (volatile int64_t *target, const int64_t value) Replaces a 64-bit signed integer with the given value atomically. |
| fpl_common_api size_t |
fplAtomicExchangeSize (volatile size_t *target, const size_t value) Replaces a size with the given value atomically. |
| fpl_platform_api uint32_t |
fplAtomicExchangeU32 (volatile uint32_t *target, const uint32_t value) Replaces a 32-bit unsigned integer with the given value atomically. |
| fpl_platform_api uint64_t |
fplAtomicExchangeU64 (volatile uint64_t *target, const uint64_t value) Replaces a 64-bit unsigned integer with the given value atomically. |
| fpl_common_api void * |
fplAtomicFetchAndAddPtr (volatile void **dest, const intptr_t addend) Adds a addend to the pointer atomically and returns the initial value before the add. |
| fpl_platform_api int32_t |
fplAtomicFetchAndAddS32 (volatile int32_t *value, const int32_t addend) Adds a 32-bit signed integer to the value by the given addend atomically. |
| fpl_platform_api int64_t |
fplAtomicFetchAndAddS64 (volatile int64_t *value, const int64_t addend) Adds a 64-bit signed integer to the value by the given addend atomically. |
| fpl_common_api size_t |
fplAtomicFetchAndAddSize (volatile size_t *dest, const size_t addend) Adds a size to the value by the given addend atomically. |
| fpl_platform_api uint32_t |
fplAtomicFetchAndAddU32 (volatile uint32_t *value, const uint32_t addend) Adds a 32-bit unsigned integer to the value by the given addend atomically. |
| fpl_platform_api uint64_t |
fplAtomicFetchAndAddU64 (volatile uint64_t *value, const uint64_t addend) Adds a 64-bit unsigned integer to the value by the given addend atomically. |
| fpl_common_api void * |
fplAtomicIncrementPtr (volatile void **dest) Increments/Advances the given pointer by one atomically. |
| fpl_platform_api int32_t |
fplAtomicIncrementS32 (volatile int32_t *dest) Increments the given 32-bit signed integer by one atomically. |
| fpl_platform_api int64_t |
fplAtomicIncrementS64 (volatile int64_t *dest) Increments the given 64-bit signed integer by one atomically. |
| fpl_common_api size_t |
fplAtomicIncrementSize (volatile size_t *dest) Increments the given size by one atomically. |
| fpl_platform_api uint32_t |
fplAtomicIncrementU32 (volatile uint32_t *dest) Increments the given 32-bit unsigned integer by one atomically. |
| fpl_platform_api uint64_t |
fplAtomicIncrementU64 (volatile uint64_t *dest) Increments the given 64-bit unsigned integer by one atomically. |
| fpl_common_api bool |
fplAtomicIsCompareAndSwapPtr (volatile void **dest, const void *comparand, const void *exchange) Compares a pointer with a comparand and swaps it when comparand matches the destination and returns a bool indicating the result. |
| fpl_platform_api bool |
fplAtomicIsCompareAndSwapS32 (volatile int32_t *dest, const int32_t comparand, const int32_t exchange) Compares a 32-bit signed integer with a comparand and swaps it when comparand matches the destination and returns a bool indicating the result. |
| fpl_platform_api bool |
fplAtomicIsCompareAndSwapS64 (volatile int64_t *dest, const int64_t comparand, const int64_t exchange) Compares a 64-bit signed integer with a comparand and swaps it when comparand matches the destination and returns a bool indicating the result. |
| fpl_common_api bool |
fplAtomicIsCompareAndSwapSize (volatile size_t *dest, const size_t comparand, const size_t exchange) Compares a size with a comparand and swaps it when comparand matches the destination and returns a bool indicating the result. |
| fpl_platform_api bool |
fplAtomicIsCompareAndSwapU32 (volatile uint32_t *dest, const uint32_t comparand, const uint32_t exchange) Compares a 32-bit unsigned integer with a comparand and swaps it when comparand matches the destination and returns a bool indicating the result. |
| fpl_platform_api bool |
fplAtomicIsCompareAndSwapU64 (volatile uint64_t *dest, const uint64_t comparand, const uint64_t exchange) Compares a 64-bit unsigned integer with a comparand and swaps it when comparand matches the destination and returns a bool indicating the result. |
| fpl_common_api void * |
fplAtomicLoadPtr (volatile void **source) Loads the pointer value atomically and returns the value. |
| fpl_platform_api int32_t |
fplAtomicLoadS32 (volatile int32_t *source) Loads the 32-bit signed value atomically and returns the value. |
| fpl_platform_api int64_t |
fplAtomicLoadS64 (volatile int64_t *source) Loads the 64-bit signed value atomically and returns the value. |
| fpl_common_api size_t |
fplAtomicLoadSize (volatile size_t *source) Loads the size value atomically and returns the value. |
| fpl_platform_api uint32_t |
fplAtomicLoadU32 (volatile uint32_t *source) Loads the 32-bit unsigned value atomically and returns the value. |
| fpl_platform_api uint64_t |
fplAtomicLoadU64 (volatile uint64_t *source) Loads the 64-bit unsigned value atomically and returns the value. |
| fpl_platform_api void |
fplAtomicReadFence (void) Inserts a memory read fence/barrier. |
| fpl_platform_api void |
fplAtomicReadWriteFence (void) Inserts a memory read and write fence/barrier. |
| fpl_common_api void |
fplAtomicStorePtr (volatile void **dest, const void *value) Overwrites the pointer value atomically. |
| fpl_platform_api void |
fplAtomicStoreS32 (volatile int32_t *dest, const int32_t value) Overwrites the 32-bit signed value atomically. |
| fpl_platform_api void |
fplAtomicStoreS64 (volatile int64_t *dest, const int64_t value) Overwrites the 64-bit signed value atomically. |
| fpl_common_api void |
fplAtomicStoreSize (volatile size_t *dest, const size_t value) Overwrites the size value atomically. |
| fpl_platform_api void |
fplAtomicStoreU32 (volatile uint32_t *dest, const uint32_t value) Overwrites the 32-bit unsigned value atomically. |
| fpl_platform_api void |
fplAtomicStoreU64 (volatile uint64_t *dest, const uint64_t value) Overwrites the 64-bit unsigned value atomically. |
| fpl_platform_api void |
fplAtomicWriteFence (void) Inserts a memory write fence/barrier. |
This category contains functions for handling atomic operations, such as Add, Compare And/Or Exchange, Fences, Loads/Stores, etc.
See also: Atomics
fpl_common_api void * fplAtomicAddAndFetchPtr ( volatile void ** dest, const intptr_t addend )Adds the addend to destination pointer atomically and returns the result after the addition.
Parameters
| Direction | Parameter | Description |
|---|---|---|
| [in,out] | dest | The target value to add to. |
| [in] | addend | The value used for adding. |
Returns: Returns the value after the addition.
Note: Ensures that memory operations are completed in order.
See also: Fetch-And-Add (Add)
fpl_platform_api int32_t fplAtomicAddAndFetchS32 ( volatile int32_t * dest, const int32_t addend )Adds the addend to destination 32-bit signed integer atomically and returns the result after the addition.
Parameters
| Direction | Parameter | Description |
|---|---|---|
| [in,out] | dest | The target value to add to. |
| [in] | addend | The value used for adding. |
Returns: Returns the value after the addition.
Note: Ensures that memory operations are completed in order.
See also: Fetch-And-Add (Add)
fpl_platform_api int64_t fplAtomicAddAndFetchS64 ( volatile int64_t * dest, const int64_t addend )Adds the addend to destination 64-bit signed integer atomically and returns the result after the addition.
Parameters
| Direction | Parameter | Description |
|---|---|---|
| [in,out] | dest | The target value to add to. |
| [in] | addend | The value used for adding. |
Returns: Returns the value after the addition.
Note: Ensures that memory operations are completed in order.
See also: Fetch-And-Add (Add)
fpl_common_api size_t fplAtomicAddAndFetchSize ( volatile size_t * dest, const size_t addend )Adds the addend to destination size atomically and returns the result after the addition.
Parameters
| Direction | Parameter | Description |
|---|---|---|
| [in,out] | dest | The target value to add to. |
| [in] | addend | The value used for adding. |
Returns: Returns the value after the addition.
Note: Ensures that memory operations are completed in order.
See also: Fetch-And-Add (Add)
fpl_platform_api uint32_t fplAtomicAddAndFetchU32 ( volatile uint32_t * dest, const uint32_t addend )Adds the addend to destination 32-bit unsigned integer atomically and returns the result after the addition.
Parameters
| Direction | Parameter | Description |
|---|---|---|
| [in,out] | dest | The target value to add to. |
| [in] | addend | The value used for adding. |
Returns: Returns the value after the addition.
Note: Ensures that memory operations are completed in order.
See also: Fetch-And-Add (Add)
fpl_platform_api uint64_t fplAtomicAddAndFetchU64 ( volatile uint64_t * dest, const uint64_t addend )Adds the addend to destination 64-bit unsigned integer atomically and returns the result after the addition.
Parameters
| Direction | Parameter | Description |
|---|---|---|
| [in,out] | dest | The target value to add to. |
| [in] | addend | The value used for adding. |
Returns: Returns the value after the addition.
Note: Ensures that memory operations are completed in order.
See also: Fetch-And-Add (Add)
fpl_common_api void * fplAtomicCompareAndSwapPtr ( volatile void ** dest, const void * comparand, const void * exchange )Compares a pointer with a comparand and swaps it when comparand matches the destination.
Parameters
| Direction | Parameter | Description |
|---|---|---|
| [in,out] | dest | The target value to write into. |
| [in] | comparand | The value to compare with. |
| [in] | exchange | The value to exchange with. |
Returns: Returns the value of the destination before the swap, regardless of the result.
Note: Ensures that memory operations are completed in order.
Use
fplAtomicIsCompareAndSwapPtr() when you want to check if the exchange has happened or not.
See also: Compare-And-Swap
fpl_platform_api int32_t fplAtomicCompareAndSwapS32 ( volatile int32_t * dest, const int32_t comparand, const int32_t exchange )Compares a 32-bit signed integer with a comparand and swaps it when comparand matches the destination.
Parameters
| Direction | Parameter | Description |
|---|---|---|
| [in,out] | dest | The target value to write into. |
| [in] | comparand | The value to compare with. |
| [in] | exchange | The value to exchange with. |
Returns: Returns the value of the destination before the swap, regardless of the result.
Note: Ensures that memory operations are completed in order.
Use
fplAtomicIsCompareAndSwapS32() when you want to check if the exchange has happened or not.
See also: Compare-And-Swap
fpl_platform_api int64_t fplAtomicCompareAndSwapS64 ( volatile int64_t * dest, const int64_t comparand, const int64_t exchange )Compares a 64-bit signed integer with a comparand and swaps it when comparand matches the destination.
Parameters
| Direction | Parameter | Description |
|---|---|---|
| [in,out] | dest | The target value to write into. |
| [in] | comparand | The value to compare with. |
| [in] | exchange | The value to exchange with. |
Returns: Returns the value of the destination before the swap, regardless of the result.
Note: Ensures that memory operations are completed in order.
Use
fplAtomicIsCompareAndSwapS64() when you want to check if the exchange has happened or not.
See also: Compare-And-Swap
fpl_common_api size_t fplAtomicCompareAndSwapSize ( volatile size_t * dest, const size_t comparand, const size_t exchange )Compares a size with a comparand and swaps it when comparand matches the destination.
Parameters
| Direction | Parameter | Description |
|---|---|---|
| [in,out] | dest | The target value to write into. |
| [in] | comparand | The value to compare with. |
| [in] | exchange | The value to exchange with. |
Returns: Returns the value of the destination before the swap, regardless of the result.
Note: Ensures that memory operations are completed in order.
Use
fplAtomicIsCompareAndSwapSize() when you want to check if the exchange has happened or not.
See also: Compare-And-Swap
fpl_platform_api uint32_t fplAtomicCompareAndSwapU32 ( volatile uint32_t * dest, const uint32_t comparand, const uint32_t exchange )Compares a 32-bit unsigned integer with a comparand and swaps it when comparand matches the destination.
Parameters
| Direction | Parameter | Description |
|---|---|---|
| [in,out] | dest | The target value to write into. |
| [in] | comparand | The value to compare with. |
| [in] | exchange | The value to exchange with. |
Returns: Returns the value of the destination before the swap, regardless of the result.
Note: Ensures that memory operations are completed in order.
Use
fplAtomicIsCompareAndSwapU32() when you want to check if the exchange has happened or not.
See also: Compare-And-Swap
fpl_platform_api uint64_t fplAtomicCompareAndSwapU64 ( volatile uint64_t * dest, const uint64_t comparand, const uint64_t exchange )Compares a 64-bit unsigned integer with a comparand and swaps it when comparand matches the destination.
Parameters
| Direction | Parameter | Description |
|---|---|---|
| [in,out] | dest | The target value to write into. |
| [in] | comparand | The value to compare with. |
| [in] | exchange | The value to exchange with. |
Returns: Returns the value of the destination before the swap, regardless of the result.
Note: Ensures that memory operations are completed in order.
Use
fplAtomicIsCompareAndSwapU64() when you want to check if the exchange has happened or not.
See also: Compare-And-Swap
fpl_common_api void * fplAtomicExchangePtr ( volatile void ** target, const void * value )Replaces a pointer with the given value atomically.
Parameters
| Direction | Parameter | Description |
|---|---|---|
| [in,out] | target | The target value to write into. |
| [in] | value | The source value used for exchange. |
Returns: Returns the initial value before the replacement.
Note: Ensures that memory operations are completed in order.
See also: Exchange
fpl_platform_api int32_t fplAtomicExchangeS32 ( volatile int32_t * target, const int32_t value )Replaces a 32-bit signed integer with the given value atomically.
Parameters
| Direction | Parameter | Description |
|---|---|---|
| [in,out] | target | The target value to write into. |
| [in] | value | The source value used for exchange. |
Returns: Returns the initial value before the replacement.
Note: Ensures that memory operations are completed in order.
See also: Exchange
fpl_platform_api int64_t fplAtomicExchangeS64 ( volatile int64_t * target, const int64_t value )Replaces a 64-bit signed integer with the given value atomically.
Parameters
| Direction | Parameter | Description |
|---|---|---|
| [in,out] | target | The target value to write into. |
| [in] | value | The source value used for exchange. |
Returns: Returns the initial value before the replacement.
Note: Ensures that memory operations are completed in order.
See also: Exchange
fpl_common_api size_t fplAtomicExchangeSize ( volatile size_t * target, const size_t value )Replaces a size with the given value atomically.
Parameters
| Direction | Parameter | Description |
|---|---|---|
| [in,out] | target | The target value to write into. |
| [in] | value | The source value used for exchange. |
Returns: Returns the initial value before the replacement.
Note: Ensures that memory operations are completed in order.
See also: Exchange
fpl_platform_api uint32_t fplAtomicExchangeU32 ( volatile uint32_t * target, const uint32_t value )Replaces a 32-bit unsigned integer with the given value atomically.
Parameters
| Direction | Parameter | Description |
|---|---|---|
| [in,out] | target | The target value to write into. |
| [in] | value | The source value used for exchange. |
Returns: Returns the initial value before the replacement.
Note: Ensures that memory operations are completed in order.
See also: Exchange
fpl_platform_api uint64_t fplAtomicExchangeU64 ( volatile uint64_t * target, const uint64_t value )Replaces a 64-bit unsigned integer with the given value atomically.
Parameters
| Direction | Parameter | Description |
|---|---|---|
| [in,out] | target | The target value to write into. |
| [in] | value | The source value used for exchange. |
Returns: Returns the initial value before the replacement.
Note: Ensures that memory operations are completed in order.
See also: Exchange
fpl_common_api void * fplAtomicFetchAndAddPtr ( volatile void ** dest, const intptr_t addend )Adds a addend to the pointer atomically and returns the initial value before the add.
Parameters
| Direction | Parameter | Description |
|---|---|---|
| [in,out] | dest | The target value to add to. |
| [in] | addend | The value used for adding. |
Returns: Returns the initial value before the add.
Note: Ensures that memory operations are completed in order.
See also: Fetch-And-Add (Add)
fpl_platform_api int32_t fplAtomicFetchAndAddS32 ( volatile int32_t * value, const int32_t addend )Adds a 32-bit signed integer to the value by the given addend atomically.
Parameters
| Direction | Parameter | Description |
|---|---|---|
| [in,out] | value | The target value to add to. |
| [in] | addend | The value used for adding. |
Returns: Returns the initial value before the add.
Note: Ensures that memory operations are completed in order.
See also: Fetch-And-Add (Add)
fpl_platform_api int64_t fplAtomicFetchAndAddS64 ( volatile int64_t * value, const int64_t addend )Adds a 64-bit signed integer to the value by the given addend atomically.
Parameters
| Direction | Parameter | Description |
|---|---|---|
| [in,out] | value | The target value to add to. |
| [in] | addend | The value used for adding. |
Returns: Returns the initial value before the add.
Note: Ensures that memory operations are completed in order.
See also: Fetch-And-Add (Add)
fpl_common_api size_t fplAtomicFetchAndAddSize ( volatile size_t * dest, const size_t addend )Adds a size to the value by the given addend atomically.
Parameters
| Direction | Parameter | Description |
|---|---|---|
| [in,out] | dest | The target value to add to. |
| [in] | addend | The value used for adding. |
Returns: Returns the initial value before the add.
Note: Ensures that memory operations are completed in order.
See also: Fetch-And-Add (Add)
fpl_platform_api uint32_t fplAtomicFetchAndAddU32 ( volatile uint32_t * value, const uint32_t addend )Adds a 32-bit unsigned integer to the value by the given addend atomically.
Parameters
| Direction | Parameter | Description |
|---|---|---|
| [in,out] | value | The target value to add to. |
| [in] | addend | The value used for adding. |
Returns: Returns the initial value before the add.
Note: Ensures that memory operations are completed in order.
See also: Fetch-And-Add (Add)
fpl_platform_api uint64_t fplAtomicFetchAndAddU64 ( volatile uint64_t * value, const uint64_t addend )Adds a 64-bit unsigned integer to the value by the given addend atomically.
Parameters
| Direction | Parameter | Description |
|---|---|---|
| [in,out] | value | The target value to add to. |
| [in] | addend | The value used for adding. |
Returns: Returns the initial value before the add.
Note: Ensures that memory operations are completed in order.
See also: Fetch-And-Add (Add)
fpl_common_api void * fplAtomicIncrementPtr ( volatile void ** dest)Increments/Advances the given pointer by one atomically.
Parameters
| Direction | Parameter | Description |
|---|---|---|
| [in,out] | dest | The target value to increment to. |
Returns: Returns the next address, after the increment.
Note: Ensures that memory operations are completed in order.
See also: Add-And-Fetch (Increment)
fpl_platform_api int32_t fplAtomicIncrementS32 ( volatile int32_t * dest)Increments the given 32-bit signed integer by one atomically.
Parameters
| Direction | Parameter | Description |
|---|---|---|
| [in,out] | dest | The target value to increment to. |
Returns: Returns the value after the increment.
Note: Ensures that memory operations are completed in order.
See also: Add-And-Fetch (Increment)
fpl_platform_api int64_t fplAtomicIncrementS64 ( volatile int64_t * dest)Increments the given 64-bit signed integer by one atomically.
Parameters
| Direction | Parameter | Description |
|---|---|---|
| [in,out] | dest | The target value to increment to. |
Returns: Returns the value after the increment.
Note: Ensures that memory operations are completed in order.
See also: Add-And-Fetch (Increment)
fpl_common_api size_t fplAtomicIncrementSize ( volatile size_t * dest)Increments the given size by one atomically.
Parameters
| Direction | Parameter | Description |
|---|---|---|
| [in,out] | dest | The target value to increment to. |
Returns: Returns the value after the increment.
Note: Ensures that memory operations are completed in order.
See also: Add-And-Fetch (Increment)
fpl_platform_api uint32_t fplAtomicIncrementU32 ( volatile uint32_t * dest)Increments the given 32-bit unsigned integer by one atomically.
Parameters
| Direction | Parameter | Description |
|---|---|---|
| [in,out] | dest | The target value to increment to. |
Returns: Returns the value after the increment.
Note: Ensures that memory operations are completed in order.
See also: Add-And-Fetch (Increment)
fpl_platform_api uint64_t fplAtomicIncrementU64 ( volatile uint64_t * dest)Increments the given 64-bit unsigned integer by one atomically.
Parameters
| Direction | Parameter | Description |
|---|---|---|
| [in,out] | dest | The target value to increment to. |
Returns: Returns the value after the increment.
Note: Ensures that memory operations are completed in order.
See also: Add-And-Fetch (Increment)
fpl_common_api bool fplAtomicIsCompareAndSwapPtr ( volatile void ** dest, const void * comparand, const void * exchange )Compares a pointer with a comparand and swaps it when comparand matches the destination and returns a bool indicating the result.
Parameters
| Direction | Parameter | Description |
|---|---|---|
| [in,out] | dest | The target value to write into. |
| [in] | comparand | The value to compare with. |
| [in] | exchange | The value to exchange with. |
Returns: Returns true when the exchange happened, false otherwise.
Note: Ensures that memory operations are completed in order.
See also: Compare-And-Swap
fpl_platform_api bool fplAtomicIsCompareAndSwapS32 ( volatile int32_t * dest, const int32_t comparand, const int32_t exchange )Compares a 32-bit signed integer with a comparand and swaps it when comparand matches the destination and returns a bool indicating the result.
Parameters
| Direction | Parameter | Description |
|---|---|---|
| [in,out] | dest | The target value to write into. |
| [in] | comparand | The value to compare with. |
| [in] | exchange | The value to exchange with. |
Returns: Returns true when the exchange happened, false otherwise.
Note: Ensures that memory operations are completed in order.
See also: Compare-And-Swap
fpl_platform_api bool fplAtomicIsCompareAndSwapS64 ( volatile int64_t * dest, const int64_t comparand, const int64_t exchange )Compares a 64-bit signed integer with a comparand and swaps it when comparand matches the destination and returns a bool indicating the result.
Parameters
| Direction | Parameter | Description |
|---|---|---|
| [in,out] | dest | The target value to write into. |
| [in] | comparand | The value to compare with. |
| [in] | exchange | The value to exchange with. |
Returns: Returns true when the exchange happened, false otherwise.
Note: Ensures that memory operations are completed in order.
See also: Compare-And-Swap
fpl_common_api bool fplAtomicIsCompareAndSwapSize ( volatile size_t * dest, const size_t comparand, const size_t exchange )Compares a size with a comparand and swaps it when comparand matches the destination and returns a bool indicating the result.
Parameters
| Direction | Parameter | Description |
|---|---|---|
| [in,out] | dest | The target value to write into. |
| [in] | comparand | The value to compare with. |
| [in] | exchange | The value to exchange with. |
Returns: Returns true when the exchange happened, false otherwise.
Note: Ensures that memory operations are completed in order.
See also: Compare-And-Swap
fpl_platform_api bool fplAtomicIsCompareAndSwapU32 ( volatile uint32_t * dest, const uint32_t comparand, const uint32_t exchange )Compares a 32-bit unsigned integer with a comparand and swaps it when comparand matches the destination and returns a bool indicating the result.
Parameters
| Direction | Parameter | Description |
|---|---|---|
| [in,out] | dest | The target value to write into. |
| [in] | comparand | The value to compare with. |
| [in] | exchange | The value to exchange with. |
Returns: Returns true when the exchange happened, false otherwise.
Note: Ensures that memory operations are completed in order.
See also: Compare-And-Swap
fpl_platform_api bool fplAtomicIsCompareAndSwapU64 ( volatile uint64_t * dest, const uint64_t comparand, const uint64_t exchange )Compares a 64-bit unsigned integer with a comparand and swaps it when comparand matches the destination and returns a bool indicating the result.
Parameters
| Direction | Parameter | Description |
|---|---|---|
| [in,out] | dest | The target value to write into. |
| [in] | comparand | The value to compare with. |
| [in] | exchange | The value to exchange with. |
Returns: Returns true when the exchange happened, false otherwise.
Note: Ensures that memory operations are completed in order.
See also: Compare-And-Swap
fpl_common_api void * fplAtomicLoadPtr ( volatile void ** source)Loads the pointer value atomically and returns the value.
Note: Ensures that memory operations are completed before the reading.
This may use a CAS instruction when there are no suitable compiler intrinsics found.
Parameters
| Direction | Parameter | Description |
|---|---|---|
| [in] | source | The source value to read from. |
Returns: Returns the atomically loaded source value
See also: Load
fpl_platform_api int32_t fplAtomicLoadS32 ( volatile int32_t * source)Loads the 32-bit signed value atomically and returns the value.
Parameters
| Direction | Parameter | Description |
|---|---|---|
| [in] | source | The source value to read from. |
Returns: Returns the atomically loaded source value
Note: Ensures that memory operations are completed before the reading.
This may use a CAS instruction when there are no suitable compiler intrinsics found.
See also: Load
fpl_platform_api int64_t fplAtomicLoadS64 ( volatile int64_t * source)Loads the 64-bit signed value atomically and returns the value.
Parameters
| Direction | Parameter | Description |
|---|---|---|
| [in] | source | The source value to read from. |
Returns: Returns the atomically loaded source value
Note: Ensures that memory operations are completed before the reading.
This may use a CAS instruction when there are no suitable compiler intrinsics found.
See also: Load
fpl_common_api size_t fplAtomicLoadSize ( volatile size_t * source)Loads the size value atomically and returns the value.
Note: Ensures that memory operations are completed before the reading.
This may use a CAS instruction when there are no suitable compiler intrinsics found.
Parameters
| Direction | Parameter | Description |
|---|---|---|
| [in] | source | The source value to read from. |
Returns: Returns the atomically loaded source value
See also: Load
fpl_platform_api uint32_t fplAtomicLoadU32 ( volatile uint32_t * source)Loads the 32-bit unsigned value atomically and returns the value.
Parameters
| Direction | Parameter | Description |
|---|---|---|
| [in] | source | The source value to read from. |
Returns: Returns the atomically loaded source value
Note: Ensures that memory operations are completed before the reading.
This may use a CAS instruction when there are no suitable compiler intrinsics found.
See also: Load
fpl_platform_api uint64_t fplAtomicLoadU64 ( volatile uint64_t * source)Loads the 64-bit unsigned value atomically and returns the value.
Parameters
| Direction | Parameter | Description |
|---|---|---|
| [in] | source | The source value to read from. |
Returns: Returns the atomically loaded source value
Note: Ensures that memory operations are completed before the reading.
This may use a CAS instruction when there are no suitable compiler intrinsics found.
See also: Load
fpl_platform_api void fplAtomicReadFence ( void )Inserts a memory read fence/barrier.
Note: This will complete previous reads before future reads and prevents the compiler from reordering memory reads across this fence.
See also: Memory Barriers
fpl_platform_api void fplAtomicReadWriteFence ( void )Inserts a memory read and write fence/barrier.
Note: This will complete previous reads and writes before future reads and writes and prevents the compiler from reordering memory access across this fence.
See also: Memory Barriers
fpl_common_api void fplAtomicStorePtr ( volatile void ** dest, const void * value )Overwrites the pointer value atomically.
Parameters
| Direction | Parameter | Description |
|---|---|---|
| [out] | dest | The destination to write to. |
| [in] | value | The value to exchange with. |
Note: Ensures that memory operations are completed before the write.
See also: Store
fpl_platform_api void fplAtomicStoreS32 ( volatile int32_t * dest, const int32_t value )Overwrites the 32-bit signed value atomically.
Parameters
| Direction | Parameter | Description |
|---|---|---|
| [out] | dest | The destination to write to. |
| [in] | value | The value to exchange with. |
Note: Ensures that memory operations are completed before the write.
See also: Store
fpl_platform_api void fplAtomicStoreS64 ( volatile int64_t * dest, const int64_t value )Overwrites the 64-bit signed value atomically.
Parameters
| Direction | Parameter | Description |
|---|---|---|
| [out] | dest | The destination to write to. |
| [in] | value | The value to exchange with. |
Note: Ensures that memory operations are completed before the write.
See also: Store
fpl_common_api void fplAtomicStoreSize ( volatile size_t * dest, const size_t value )Overwrites the size value atomically.
Parameters
| Direction | Parameter | Description |
|---|---|---|
| [out] | dest | The destination to write to. |
| [in] | value | The value to exchange with. |
Note: Ensures that memory operations are completed before the write.
See also: Store
fpl_platform_api void fplAtomicStoreU32 ( volatile uint32_t * dest, const uint32_t value )Overwrites the 32-bit unsigned value atomically.
Parameters
| Direction | Parameter | Description |
|---|---|---|
| [out] | dest | The destination to write to. |
| [in] | value | The value to exchange with. |
Note: Ensures that memory operations are completed before the write.
See also: Store
fpl_platform_api void fplAtomicStoreU64 ( volatile uint64_t * dest, const uint64_t value )Overwrites the 64-bit unsigned value atomically.
Parameters
| Direction | Parameter | Description |
|---|---|---|
| [out] | dest | The destination to write to. |
| [in] | value | The value to exchange with. |
Note: Ensures that memory operations are completed before the write.
See also: Store
fpl_platform_api void fplAtomicWriteFence ( void )Inserts a memory write fence/barrier.
Note: This will complete previous writes before future writes and prevents the compiler from reordering memory writes across this fence.
See also: Memory Barriers
- Assertion & Debug
- Atomic operations
- Audio functions
- Clipboard functions
- Console functions
- Constants
- Display/Monitor functions
- Dynamic library loading
- Error Handling
- Files/IO functions
- Function macros
- Hardware Infos
- Input types and functions
- Localization functions
- Logging
- Memory Macros
- Memory functions
- Operating system Infos
- Path functions
- Platform functions
- Session Infos
- Settings & Configurations
- Storage class identifiers
- String functions
- Threading and synchronizations routines
- Timing functions
- Video functions
- Window events
- Window functions
- fplARMCPUCapabilities
- fplAudioChannelMap
- fplAudioDeviceID
- fplAudioDeviceInfo
- fplAudioFormat
- fplAudioSettings
- fplColor32
- fplConditionVariable
- fplConsoleSettings
- fplCPUCapabilities
- fplCPUIDLeaf
- fplDateTime
- fplDateTimeCreationResult
- fplDateTimeResult
- fplDisplayInfo
- fplDisplayMode
- fplDynamicLibraryHandle
- fplEndianess
- fplEvent
- fplFileEntry
- fplFileHandle
- fplFilePermissions
- fplFileTimeStamps
- fplGamepadButton
- fplGamepadData
- fplGamepadEvent
- fplGamepadInfo
- fplGamepadInputBinding
- fplGamepadMapping
- fplGamepadSettings
- fplGamepadState
- fplGamepadStates
- fplGraphicsApiSettings
- fplImageSource
- fplInputBackendMask
- fplInputBackendSupport
- fplInputDevice
- fplInputDeviceGuid
- fplInputSettings
- fplInternalConditionVariable
- fplInternalDynamicLibraryHandle
- fplInternalFileEntryHandle
- fplInternalFileHandle
- fplInternalFileRootInfo
- fplInternalMutexHandle
- fplInternalSemaphoreHandle
- fplInternalSignalHandle
- fplInternalThreadHandle
- fplKeyboardEvent
- fplKeyboardState
- fplLogSettings
- fplLogWriter
- fplLogWriterConsole
- fplLogWriterCustom
- fplMemoryAllocationSettings
- fplMemoryBlock
- fplMemoryInfos
- fplMemorySettings
- fplMouseEvent
- fplMouseState
- fplMutexHandle
- fplOpenGLSettings
- fplOSVersionInfos
- fplSemaphoreHandle
- fplSettings
- fplSignalHandle
- fplSpecificAudioSettings
- fplThreadHandle
- fplThreadParameters
- fplTimestamp
- fplVersionInfo
- fplVideoBackBuffer
- fplVideoRect
- fplVideoRequirements
- fplVideoRequirementsVulkan
- fplVideoSettings
- fplVideoSurface
- fplVideoSurfaceOpenGL
- fplVideoSurfaceVulkan
- fplVideoWindow
- fplVulkanSettings
- fplWindowCallbacks
- fplWindowDropFiles
- fplWindowEvent
- fplWindowPosition
- fplWindowSettings
- fplWindowSize
- fplX86CPUCapabilities