...
Source file
src/github.com/ugorji/go/codec/goversion_growslice_unsafe_gte_go120.go
1
2
3
4
5
6
7 package codec
8
9 import (
10 _ "reflect"
11 "unsafe"
12 )
13
14 func growslice(typ unsafe.Pointer, old unsafeSlice, num int) (s unsafeSlice) {
15
16 num -= old.Cap - old.Len
17 s = rtgrowslice(old.Data, old.Cap+num, old.Cap, num, typ)
18 s.Len = old.Len
19 return
20 }
21
22
23
24 func rtgrowslice(oldPtr unsafe.Pointer, newLen, oldCap, num int, typ unsafe.Pointer) unsafeSlice
25
26
27
28
29
View as plain text