runtime: implement KeepAlive using inline assembly

This commit is contained in:
Ayke van Laethem
2023-02-17 01:19:53 +01:00
committed by Ron Evans
parent 361ecf9ea4
commit c02cc339c5
3 changed files with 38 additions and 6 deletions
+3 -6
View File
@@ -88,12 +88,9 @@ func LockOSThread() {
func UnlockOSThread() {
}
func KeepAlive(x 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.
}
// KeepAlive makes sure the value in the interface is alive until at least the
// point of the call.
func KeepAlive(x interface{})
var godebugUpdate func(string, string)