summaryrefslogtreecommitdiff
path: root/zap/src/memfill.c
diff options
context:
space:
mode:
Diffstat (limited to 'zap/src/memfill.c')
-rw-r--r--zap/src/memfill.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/zap/src/memfill.c b/zap/src/memfill.c
index c9a9797..1aebd29 100644
--- a/zap/src/memfill.c
+++ b/zap/src/memfill.c
@@ -6,18 +6,20 @@
#include <zap/priv.h>
+#include <zap/mem.h>
+
#include <stddef.h>
#include <stdint.h>
-#if defined(zap_priv_fastimpl)
+#if zap_priv_fastimpl
__asm__ (
".globl zap_memfill\n"
"zap_memfill:\n"
/*
- void const * ptr
- size_t num
- uint_least8_t val
+ void const * ptr
+ size_t num
+ unsigned char val
*/
#if defined(sus_arch_amd64)
/* rdi: Address of the current element. */
@@ -50,9 +52,9 @@ __asm__ (
#endif
);
#else
-void zap_memfill(void * const _ptr,size_t const _num,uint_least8_t const _byte) {
- uint_least8_t * pos = (uint_least8_t *)_ptr;
- uint_least8_t * const afterbuf = pos + _num;
+void zap_memfill(void * const _ptr,size_t const _num,unsigned char const _byte) {
+ unsigned char * pos = _ptr;
+ unsigned char * const afterbuf = pos + _num;
for (;pos != afterbuf;++pos) {*pos = _byte;}
}
#endif