mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-06 12:03:41 +00:00
Implement runtime functions for reflect
The reflect package isn't supported yet. But at least the Go parser/typechecker can now deal with it.
This commit is contained in:
@@ -28,3 +28,11 @@ func alloc(size uintptr) unsafe.Pointer {
|
||||
func free(ptr unsafe.Pointer) {
|
||||
// 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) {
|
||||
//C.free(ptr) // TODO
|
||||
}
|
||||
|
||||
func GC() {
|
||||
// Unimplemented.
|
||||
}
|
||||
|
||||
func KeepAlive(x interface{}) {
|
||||
// Unimplemented. Only required with SetFinalizer().
|
||||
}
|
||||
|
||||
@@ -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
|
||||
}
|
||||
Reference in New Issue
Block a user