Files
goirsdk/sharedMem/utils.go
T
esilva 2bc756a2f0 Rolled back some stuff here like the package stuff
This will add support to view live data
2024-10-27 22:48:32 +00:00

16 lines
417 B
Go

package sharedMem
import (
"unsafe"
)
func copySlice2Ptr(b []byte, p uintptr, off int64, size uint32) int {
bb := unsafe.Slice((*byte)(*(*unsafe.Pointer)(unsafe.Pointer(&p))), int(size))
return copy(bb[off:], b)
}
func copyPtr2Slice(p uintptr, b []byte, off int64, size uint32) int {
bb := unsafe.Slice((*byte)(*(*unsafe.Pointer)(unsafe.Pointer(&p))), int(size))
return copy(b, bb[off:size])
}