mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-06 23:58:50 +00:00
Unify memset usage across platforms and core:c/libc
This commit is contained in:
@@ -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
|
||||
}
|
||||
Reference in New Issue
Block a user