Skip to content

Commit

Permalink
cleanup: free offsets passed to log functions when the levels don't m…
Browse files Browse the repository at this point in the history
…atch
  • Loading branch information
zshipko committed Sep 20, 2024
1 parent e3ac8cd commit 8d1c6f0
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions host.go
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,7 @@ func buildEnvModule(ctx context.Context, rt wazero.Runtime, extism api.Module) (
hostFunc(name, func(ctx context.Context, m api.Module, offset uint64) {
if plugin, ok := ctx.Value(PluginCtxKey("plugin")).(*Plugin); ok {
if LogLevel(pluginLogLevel.Load()) > level {
plugin.currentPlugin().Free(offset)
return
}

Expand Down

0 comments on commit 8d1c6f0

Please sign in to comment.