[riot-notifications] [RIOT-OS/RIOT] sys: Added simple memory barrier API (#11438)

Kaspar Schleiser notifications at github.com
Wed Apr 24 17:46:07 CEST 2019


kaspar030 commented on this pull request.



> + * located at address `0x42` and we want to use that to measure the time a call
+ * to `void do_computing(void)` takes:
+ *
+ * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ {.c}
+ * // BEWARE: This example deliberately contains **BUGS**
+ * #define TIMER    (*((uint16_t *)0x42))
+ *
+ * uint16_t measure_time(void) {
+ *     uint16_t pre = TIMER;
+ *     do_computing();
+ *     uint16_t post = TIMER;
+ *     return pre - post;
+ * }
+ * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ *
+ * In the above example from the compilers perspective the value in `TIMER`

I'm sorry, I think I deleted a comment that I thought to be a review comment. I think it was "Have you seen this in practice?".

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/RIOT-OS/RIOT/pull/11438#discussion_r278193841
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20190424/0f6979b0/attachment.html>


More information about the notifications mailing list