mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-15 00:13:43 +00:00
internal/reflectlite, reflect: move StringHeader and SliceHeader back to package reflect
This commit is contained in:
@@ -1686,12 +1686,6 @@ type funcHeader struct {
|
||||
Code unsafe.Pointer
|
||||
}
|
||||
|
||||
type SliceHeader struct {
|
||||
Data uintptr
|
||||
Len intw
|
||||
Cap intw
|
||||
}
|
||||
|
||||
// Slice header that matches the underlying structure. Used for when we switch
|
||||
// to a precise GC, which needs to know exactly where pointers live.
|
||||
type sliceHeader struct {
|
||||
@@ -1700,11 +1694,6 @@ type sliceHeader struct {
|
||||
cap uintptr
|
||||
}
|
||||
|
||||
type StringHeader struct {
|
||||
Data uintptr
|
||||
Len intw
|
||||
}
|
||||
|
||||
// Like sliceHeader, this type is used internally to make sure pointer and
|
||||
// non-pointer fields match those of actual strings.
|
||||
type stringHeader struct {
|
||||
@@ -1716,9 +1705,7 @@ type stringHeader struct {
|
||||
// See https://github.com/tinygo-org/tinygo/pull/4156
|
||||
// and https://github.com/tinygo-org/tinygo/issues/1284.
|
||||
var (
|
||||
_ [unsafe.Sizeof([]byte{})]byte = [unsafe.Sizeof(SliceHeader{})]byte{}
|
||||
_ [unsafe.Sizeof([]byte{})]byte = [unsafe.Sizeof(sliceHeader{})]byte{}
|
||||
_ [unsafe.Sizeof("")]byte = [unsafe.Sizeof(StringHeader{})]byte{}
|
||||
_ [unsafe.Sizeof("")]byte = [unsafe.Sizeof(stringHeader{})]byte{}
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user