projects
/
oweals
/
musl.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
193338e
)
optimize explicit_bzero for size
author
Alexander Monakov
<amonakov@ispras.ru>
Thu, 28 Jun 2018 17:57:29 +0000
(20:57 +0300)
committer
Rich Felker
<dalias@aerifal.cx>
Mon, 2 Jul 2018 21:14:54 +0000
(17:14 -0400)
Avoid saving/restoring the incoming argument by reusing memset return
value.
src/string/explicit_bzero.c
patch
|
blob
|
history
diff --git
a/src/string/explicit_bzero.c
b/src/string/explicit_bzero.c
index 3d27004046a5a5ea8f646d1ed0653cac1b54df58..f2e12f2375e2d63d594af539b3ad39d68e0c8422 100644
(file)
--- a/
src/string/explicit_bzero.c
+++ b/
src/string/explicit_bzero.c
@@
-3,6
+3,6
@@
void explicit_bzero(void *d, size_t n)
{
- memset(d, 0, n);
+
d =
memset(d, 0, n);
__asm__ __volatile__ ("" : : "r"(d) : "memory");
}