Begin work on supporting wasm32 architecture
This commit is contained in:
1 parent
d6bcc25b69
commit
098699103d
5 files changed
+146
-9
No files matched your search
@@ -0,0 +1,14 @@
|
||||
package runtime
|
||||
|
||||
@(link_name="memset")
|
||||
memset :: proc "c" (ptr: rawptr, val: i32, len: int) -> rawptr {
|
||||
b := byte(val);
|
||||
|
||||
p_start := uintptr(ptr);
|
||||
p_end := p_start + uintptr(max(len, 0));
|
||||
for p := p_start; p < p_end; p += 1 {
|
||||
(^byte)(p)^ = b;
|
||||
}
|
||||
|
||||
return ptr;
|
||||
}
|
||||
Reference in new issue
Block a user