QuickCppLib 0.10
Eliminate all the tedious hassle when making state-of-the-art C++ 14 - 23 libraries!
Loading...
Searching...
No Matches
P1631

Ensures that reload elimination does not happen for a region of memory, optionally synchronising the region with main memory.

Ensures that reload elimination does not happen for a region of memory, optionally synchronising the region with main memory.

Sized C byte array overload for mem_flush_stores().

Ensures that dead store elimination does not happen for a region of memory, optionally synchronising the region with main memory.

Sized C byte array overload for mem_force_reload().

Returns
The kind of memory flush actually used
Parameters
dataThe beginning of the byte array to ensure loads from.
bytesThe number of bytes to ensure loads from.
kindWhether to ensure loads from the region are from main memory. Defaults to not doing so.
orderThe atomic reordering constraints to apply to this operation. Defaults to atomic acquire constraints, which prevents reads and writes to this region subsequent to this operation being reordered to before this operation.
Note
memory_flush_retain has no effect for loads, it is the same as doing nothing. Only memory_flush_evict evicts all the cache lines for the region of memory, thus ensuring that subsequent loads are from main memory.
Returns
The kind of memory flush actually used
Parameters
dataThe beginning of the byte array to ensure stores to.
bytesThe number of bytes to ensure stores to.
kindWhether to wait until all stores to the region reach main memory. Defaults to not waiting.
orderThe atomic reordering constraints to apply to this operation. Defaults to atomic release constraints, which prevents reads and writes to this region preceding this operation being reordered to after this operation.
Warning
On older Intel CPUs, due to lack of hardware support, we always execute memory_flush_evict even if asked for memory_flush_retain. This can produce some very poor performance. Check the value returned to see what kind of flush was actually performed.