Browse Source

wasm: implement memcpy and memset

This was reported in issue #805.
pull/823/head
Ayke van Laethem 5 years ago
committed by Ron Evans
parent
commit
ab7dc45288
  1. 14
      src/runtime/runtime_wasm.go

14
src/runtime/runtime_wasm.go

@ -76,3 +76,17 @@ func memset(ptr unsafe.Pointer, c byte, size uintptr) unsafe.Pointer {
}
return ptr
}
// Implement memmove for LLVM and compiler-rt.
//go:export memmove
func libc_memmove(dst, src unsafe.Pointer, size uintptr) unsafe.Pointer {
memmove(dst, src, size)
return dst
}
// Implement memcpy for LLVM and compiler-rt.
//go:export memcpy
func libc_memcpy(dst, src unsafe.Pointer, size uintptr) unsafe.Pointer {
memcpy(dst, src, size)
return dst
}

Loading…
Cancel
Save