We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 215d680 commit 995e6baCopy full SHA for 995e6ba
output/output.go
@@ -69,15 +69,15 @@ func FLBPluginConfigKey(plugin unsafe.Pointer, key string) string {
69
return value
70
}
71
72
-var contexts []interface{}
+var contexts = make(map[uintptr]interface{})
73
74
func FLBPluginSetContext(plugin unsafe.Pointer, ctx interface{}) {
75
- i := len(contexts)
76
- contexts = append(contexts, ctx)
+ i := unsafe.Pointer(C.CString(""))
+ contexts[uintptr(i)] = ctx
77
p := (*FLBOutPlugin)(plugin)
78
- p.context.remote_context = unsafe.Pointer(uintptr(i))
+ p.context.remote_context = i
79
80
81
func FLBPluginGetContext(i unsafe.Pointer) interface{} {
82
- return contexts[int(uintptr(i))]
+ return contexts[uintptr(i)]
83
0 commit comments