mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-10 14:03:39 +00:00
runtime: implement memmove intrinsic
This should fix the following issue: https://github.com/tinygo-org/tinygo/issues/252
This commit is contained in:
committed by
Ron Evans
parent
38f8cf7bee
commit
b64fc5484a
@@ -46,10 +46,16 @@ func abort() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Implement memset for compiler-rt.
|
// Implement memset for LLVM and compiler-rt.
|
||||||
//go:export memset
|
//go:export memset
|
||||||
func memset(ptr unsafe.Pointer, c byte, size uintptr) {
|
func libc_memset(ptr unsafe.Pointer, c byte, size uintptr) {
|
||||||
for i := uintptr(0); i < size; i++ {
|
for i := uintptr(0); i < size; i++ {
|
||||||
*(*byte)(unsafe.Pointer(uintptr(ptr) + i)) = c
|
*(*byte)(unsafe.Pointer(uintptr(ptr) + i)) = c
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Implement memmove for LLVM and compiler-rt.
|
||||||
|
//go:export memmove
|
||||||
|
func libc_memmove(dst, src unsafe.Pointer, size uintptr) {
|
||||||
|
memmove(dst, src, size)
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user