SAM function SAM-Memory-region-protect()
SAM_Memory_region_protect - Protect a memory region within a SAM context
#include <sam.h> void SAM_Memory_region_protect(SAM_t sam, void *addr);
The SAM_Memory_region_protect() function is used to make the SAM Structure object sam protect a region of memory that has been previously registered. That a region memory is protected means that that the workers threads will be flashed back according to the flash back policy if they read from this region and a data dependency is detected or if they speculatively write to this memory region; and the writing will not be considered valid.
To protect a region that has not been previously registered will result in undefined behavior.
 Return value
None, assumes correct input parameters.
Example 3 A - Executing speculatively and flashing back a worker thread (inefficient version)
Example 3 B - Executing speculatively and flashing back a worker thread (efficient version)
Example 4 - Executing speculatively, flashing back, and speculative writing
Example 5 - Using multiple protected memory regions within the same SAM context