bytecodealliance / bytecodealliance/wasmtime-go

Maybe remove the not necessary `runtime.KeepAlive()`

Open
#147 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
913
Forks
100
Avg merge
10m
Merged PRs (30d)
1

Description

According to this discussion https://forum.golangbridge.org/t/curious-about-runtime-keepalive-usage/3530, some common scenarios that need to call `runtime.KeepAlive()` is
1. you have obtained the file descriptor to an underlying os.File.
2. you have passed memory to cgo which was allocated inside the same function.

In wasmtime-go, the variable that we are calling `runtime.KeepAlive()` for are normally not allocated by the same function, so I think maybe we don't need `runtime.KeepAlive()`?

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.