diff options
author | Ian Lance Taylor <ian@gcc.gnu.org> | 2019-09-17 17:22:18 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@gcc.gnu.org> | 2019-09-17 17:22:18 +0000 |
commit | 99a28ee8c18fd1f452c002f0548c54eb0a7be817 (patch) | |
tree | 4fdc56912ae62acf461872d66576ead04cf8811a /libgo/go/reflect/makefunc_ffi.go | |
parent | d0bc0cb66bcb0e6a5a5a31a9e900e8ccc98e34e5 (diff) |
reflect: unexport FFICallbackGo; use go:linkname instead
The function was always intended to be internal-only, but was exported
so that C code could call it. Now that have go:linkname for that, use it.
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/195857
From-SVN: r275809
Diffstat (limited to 'libgo/go/reflect/makefunc_ffi.go')
-rw-r--r-- | libgo/go/reflect/makefunc_ffi.go | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/libgo/go/reflect/makefunc_ffi.go b/libgo/go/reflect/makefunc_ffi.go index 4564736bc99..88ffca56ca0 100644 --- a/libgo/go/reflect/makefunc_ffi.go +++ b/libgo/go/reflect/makefunc_ffi.go @@ -15,19 +15,20 @@ func makeFuncFFI(cif unsafe.Pointer, impl unsafe.Pointer) // The makeCIF function, implemented in the runtime package, allocates a CIF. func makeCIF(ft *funcType) unsafe.Pointer -// FFICallbackGo implements the Go side of the libffi callback. -// It is exported so that C code can call it. +// Export ffiCallbackGo so that C code in makefunc_ffi_c.c can call it. +//go:linkname ffiCallbackGo + +// ffiCallbackGo implements the Go side of the libffi callback. // // The call chain arriving here looks like // some_go_caller // ->some_ffi_internals // ->ffi_callback (in C) -// ->FFICallbackGo +// ->ffiCallbackGo // // The ffi_callback handles __go_makefunc_can_recover, and // then passes off the data as received from ffi here. - -func FFICallbackGo(results unsafe.Pointer, params unsafe.Pointer, impl *makeFuncImpl) { +func ffiCallbackGo(results unsafe.Pointer, params unsafe.Pointer, impl *makeFuncImpl) { ftyp := impl.typ in := make([]Value, 0, len(ftyp.in)) ap := params |