runtime: add missing SliceClear
This commit is contained in:
@@ -20,6 +20,7 @@ import (
|
||||
"unsafe"
|
||||
|
||||
"github.com/goplus/llgo/c"
|
||||
"github.com/goplus/llgo/internal/abi"
|
||||
"github.com/goplus/llgo/internal/runtime/math"
|
||||
)
|
||||
|
||||
@@ -141,4 +142,8 @@ func panicmakeslicecap() {
|
||||
panic(errorString("makeslice: cap out of range"))
|
||||
}
|
||||
|
||||
func SliceClear(t *abi.SliceType, s Slice) {
|
||||
c.Memset(s.data, 0, uintptr(s.len)*t.Elem.Size())
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user