Implement runtime functions for reflect

The reflect package isn't supported yet. But at least the Go
parser/typechecker can now deal with it.
Этот коммит содержится в:
Ayke van Laethem 2018-08-30 22:53:34 +02:00
родитель b13cfc5255
коммит 734b0cb6bc
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: E97FF5335DFDFDED
3 изменённых файлов: 32 добавлений и 0 удалений

Просмотреть файл

@ -28,3 +28,11 @@ func alloc(size uintptr) unsafe.Pointer {
func free(ptr unsafe.Pointer) { func free(ptr unsafe.Pointer) {
// TODO: use a GC // TODO: use a GC
} }
func GC() {
// Unimplemented.
}
func KeepAlive(x interface{}) {
// Unimplemented. Only required with SetFinalizer().
}

Просмотреть файл

@ -56,3 +56,11 @@ func alloc(size uintptr) unsafe.Pointer {
func free(ptr unsafe.Pointer) { func free(ptr unsafe.Pointer) {
//C.free(ptr) // TODO //C.free(ptr) // TODO
} }
func GC() {
// Unimplemented.
}
func KeepAlive(x interface{}) {
// Unimplemented. Only required with SetFinalizer().
}

16
src/runtime/stack.go Обычный файл
Просмотреть файл

@ -0,0 +1,16 @@
package runtime
type Func struct {
}
func FuncForPC(pc uintptr) *Func {
return nil
}
func (f *Func) Name() string {
return ""
}
func Caller(skip int) (pc uintptr, file string, line int, ok bool) {
return 0, "", 0, false
}