Граф коммитов

4 коммитов

Автор SHA1 Сообщение Дата
Ayke van Laethem
c8742e2b96 reflect: use SliceHeader and StringHeader variant for internal use
These variants uses an unsafe.Pointer instead of uintptr so that the
pointer/non-pointer fields match those of real slices and strings. This
may be necessary in the future once we switch to a precise garbage
collector.
2021-05-22 21:41:06 +02:00
Ayke van Laethem
c849bccb83 reflect: let reflect.Type be of interface type
This matches the main Go implementation and (among others) fixes a
compatibility issue with the encoding/json package. The encoding/json
package compares reflect.Type variables against nil, which does not work
as long as reflect.Type is of integer type.

This also adds a reflect.RawType() function (like reflect.Type()) that
makes it easier to avoid working with interfaces in the runtime package.
It is internal only, but exported to let the runtime package use it.

This change introduces a small code size increase when working with the
reflect package, but I've tried to keep it to a minimum. Most programs
that don't make extensive use of the reflect package (and don't use
package like fmt) should not be impacted by this.
2021-03-23 14:32:33 +01:00
Takeshi Yoneda
1dec9dcbc4
implement reflect.Swapper
Signed-off-by: mathetake <takeshi@tetrate.io>
2020-10-23 21:37:35 +02:00
Ayke van Laethem
0b8beb77c1
reflect: add stub reflect package
This is necessary to compile fmt. However, it cannot link yet.
2018-10-23 15:39:53 +02:00