mailing list of musl libc
 help / color / mirror / code / Atom feed
49ced7515fab2f36e4382f7c41f2de5776471700 blob 427 bytes (raw)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
 
#include <string.h>
#include <stdlib.h>
#include <atomic.h>

void *memset_explicit(void *dest, register int c, register size_t n)
{
  register unsigned char volatile *p    = dest;
  register unsigned char volatile *stop = p + n;
  for (; p < stop; ++p)
    *p = c;
  // the CAS operation serves as memory barrier, and destroys the
  // information, if it happened to be spilled on the stack
  return a_cas_p(&dest, dest, 0);
}
debug log:

solving 49ced751 ...
found 49ced751 in https://inbox.vuxu.org/musl/b1a510c14f340b855a5900178e0191891751c8fa.1684932960.git.Jens.Gustedt@inria.fr/

applying [1/1] https://inbox.vuxu.org/musl/b1a510c14f340b855a5900178e0191891751c8fa.1684932960.git.Jens.Gustedt@inria.fr/
diff --git a/src/string/memset_explicit.c b/src/string/memset_explicit.c
new file mode 100644
index 00000000..49ced751

Checking patch src/string/memset_explicit.c...
Applied patch src/string/memset_explicit.c cleanly.

index at:
100644 49ced7515fab2f36e4382f7c41f2de5776471700	src/string/memset_explicit.c

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).