Created
September 20, 2016 19:58
-
-
Save j0inty/5353d5c77b49434c329df10528762cf9 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Guarantueed that the memory will set with c through the volatile instruction to the compiler. | |
*/ | |
void *guaranteed_memset(void *v,int c,size_t n) | |
{ | |
volatile char *p=v; | |
while (n--) | |
{ | |
*p++=c; | |
} | |
return v; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment