ssa: builtin len&cap

This commit is contained in:
visualfc
2024-05-02 15:49:32 +08:00
parent 5bd28a1e9e
commit 3e6dfa3c05
8 changed files with 118 additions and 27 deletions

View File

@@ -44,6 +44,11 @@ func SliceLen(s Slice) int {
return s.len
}
// SliceCap returns the capacity of a slice.
func SliceCap(s Slice) int {
return s.cap
}
// SliceData returns the data pointer of a slice.
func SliceData(s Slice) unsafe.Pointer {
return s.data