mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-16 10:43:29 +00:00
compiler: add support for new unsafe slice/string functions
This adds support for unsafe.SliceData, unsafe.String, and unsafe.SringData that were introduced in Go 1.20.
This commit is contained in:
committed by
Ron Evans
parent
33489d6344
commit
c43958972c
Vendored
+15
@@ -0,0 +1,15 @@
|
||||
package main
|
||||
|
||||
import "unsafe"
|
||||
|
||||
func unsafeSliceData(s []int) *int {
|
||||
return unsafe.SliceData(s)
|
||||
}
|
||||
|
||||
func unsafeString(ptr *byte, len int16) string {
|
||||
return unsafe.String(ptr, len)
|
||||
}
|
||||
|
||||
func unsafeStringData(s string) *byte {
|
||||
return unsafe.StringData(s)
|
||||
}
|
||||
Reference in New Issue
Block a user