Unify memset usage across platforms and core:c/libc

This commit is contained in:
gingerBill
2021-09-10 15:59:14 +01:00
parent c519ab9401
commit 12af657369
7 changed files with 4 additions and 174 deletions
-15
View File
@@ -1,15 +0,0 @@
//+build wasm32
//+private
package runtime
@(link_name="memset")
memset :: proc "c" (ptr: rawptr, val: i32, len: int) -> rawptr #no_bounds_check {
if ptr != nil && len != 0 {
b := byte(val)
p := ([^]byte)(ptr)[:len]
for v in &p {
v = b
}
}
return ptr
}