From f6df2761187f1975e35eb43461d735d6e325df85 Mon Sep 17 00:00:00 2001 From: Anuraag Agrawal Date: Fri, 17 Feb 2023 08:51:51 +0900 Subject: runtime: allow custom-gc SetFinalizer and clarify KeepAlive --- src/runtime/runtime.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'src/runtime/runtime.go') diff --git a/src/runtime/runtime.go b/src/runtime/runtime.go index a9778eaeb..586a610ae 100644 --- a/src/runtime/runtime.go +++ b/src/runtime/runtime.go @@ -89,11 +89,10 @@ func UnlockOSThread() { } func KeepAlive(x interface{}) { - // Unimplemented. Only required with SetFinalizer(). -} - -func SetFinalizer(obj interface{}, finalizer interface{}) { // Unimplemented. + // TODO: This function needs to be implemented in a way that LLVM doesn't optimize away the x + // parameter. This will likely need either a volatile operation or calling an assembly stub + // that simply returns. } var godebugUpdate func(string, string) -- cgit v1.2.3