File tree 5 files changed +24
-16
lines changed 5 files changed +24
-16
lines changed Original file line number Diff line number Diff line change @@ -1686,12 +1686,6 @@ type funcHeader struct {
1686
1686
Code unsafe.Pointer
1687
1687
}
1688
1688
1689
- type SliceHeader struct {
1690
- Data uintptr
1691
- Len intw
1692
- Cap intw
1693
- }
1694
-
1695
1689
// Slice header that matches the underlying structure. Used for when we switch
1696
1690
// to a precise GC, which needs to know exactly where pointers live.
1697
1691
type sliceHeader struct {
@@ -1700,11 +1694,6 @@ type sliceHeader struct {
1700
1694
cap uintptr
1701
1695
}
1702
1696
1703
- type StringHeader struct {
1704
- Data uintptr
1705
- Len intw
1706
- }
1707
-
1708
1697
// Like sliceHeader, this type is used internally to make sure pointer and
1709
1698
// non-pointer fields match those of actual strings.
1710
1699
type stringHeader struct {
@@ -1716,9 +1705,7 @@ type stringHeader struct {
1716
1705
// See https://github.com/tinygo-org/tinygo/pull/4156
1717
1706
// and https://github.com/tinygo-org/tinygo/issues/1284.
1718
1707
var (
1719
- _ [unsafe .Sizeof ([]byte {})]byte = [unsafe .Sizeof (SliceHeader {})]byte {}
1720
1708
_ [unsafe .Sizeof ([]byte {})]byte = [unsafe .Sizeof (sliceHeader {})]byte {}
1721
- _ [unsafe .Sizeof ("" )]byte = [unsafe .Sizeof (StringHeader {})]byte {}
1722
1709
_ [unsafe .Sizeof ("" )]byte = [unsafe .Sizeof (stringHeader {})]byte {}
1723
1710
)
1724
1711
Original file line number Diff line number Diff line change 1
1
//go:build !avr
2
2
3
- package reflectlite
3
+ package reflect
4
4
5
5
// intw is an integer type, used in places where an int is typically required,
6
6
// except architectures where the size of an int != word size.
Original file line number Diff line number Diff line change 1
1
//go:build avr
2
2
3
- package reflectlite
3
+ package reflect
4
4
5
5
// intw is an integer type, used in places where an int is typically required,
6
6
// except architectures where the size of an int != word size.
Original file line number Diff line number Diff line change 1
1
//go:build !avr
2
2
3
- package reflectlite_test
3
+ package reflect_test
4
4
5
5
import (
6
6
"reflect"
Original file line number Diff line number Diff line change @@ -226,3 +226,24 @@ func (v Value) Recv() (x Value, ok bool) {
226
226
func NewAt (typ Type , p unsafe.Pointer ) Value {
227
227
panic ("unimplemented: reflect.New()" )
228
228
}
229
+
230
+ // Deprecated: Use unsafe.Slice or unsafe.SliceData instead.
231
+ type SliceHeader struct {
232
+ Data uintptr
233
+ Len intw
234
+ Cap intw
235
+ }
236
+
237
+ // Deprecated: Use unsafe.String or unsafe.StringData instead.
238
+ type StringHeader struct {
239
+ Data uintptr
240
+ Len intw
241
+ }
242
+
243
+ // Verify SliceHeader and StringHeader sizes.
244
+ // See https://github.com/tinygo-org/tinygo/pull/4156
245
+ // and https://github.com/tinygo-org/tinygo/issues/1284.
246
+ var (
247
+ _ [unsafe .Sizeof ([]byte {})]byte = [unsafe .Sizeof (SliceHeader {})]byte {}
248
+ _ [unsafe .Sizeof ("" )]byte = [unsafe .Sizeof (StringHeader {})]byte {}
249
+ )
You can’t perform that action at this time.
0 commit comments