Better handling of slice size vs. capacity in pointers to pointers.

This commit is contained in:
gmp
2019-05-29 00:02:27 -04:00
parent 840a055a11
commit 2f4d76c6af
3 changed files with 6 additions and 5 deletions
+1 -1
View File
@@ -977,7 +977,7 @@ func %s%s(%s) %s {
continue
}
w.goCode.WriteString(fmt.Sprintf(`
%s := make([]unsafe.Pointer,len(*%s))
%s := make([]unsafe.Pointer,cap(*%s))
for i := 0; i < len(*%s); i++ {
%s[i] = (*%s)[i].Ptr()
}