@@ -99,7 +99,8 @@ func OutputJSON(v any) error {
99
99
}
100
100
101
101
mem := AllocateBytes (b )
102
- defer mem .Free ()
102
+ // TODO: coordinate replacement of call to free based on SDK alignment
103
+ // defer mem.Free()
103
104
OutputMemory (mem )
104
105
return nil
105
106
}
@@ -178,7 +179,8 @@ func SetError(err error) {
178
179
// SetErrorString sets the host error string from `err`.
179
180
func SetErrorString (err string ) {
180
181
mem := AllocateString (err )
181
- defer mem .Free ()
182
+ // TODO: coordinate replacement of call to free based on SDK alignment
183
+ // defer mem.Free()
182
184
extismErrorSet (mem .offset )
183
185
}
184
186
@@ -216,7 +218,8 @@ func LogMemory(level LogLevel, memory Memory) {
216
218
// Log logs the provided UTF-8 string `s` on the host using the provided log `level`.
217
219
func Log (level LogLevel , s string ) {
218
220
mem := AllocateString (s )
219
- defer mem .Free ()
221
+ // TODO: coordinate replacement of call to free based on SDK alignment
222
+ // defer mem.Free()
220
223
221
224
LogMemory (level , mem )
222
225
}
@@ -241,10 +244,12 @@ func GetVar(key string) []byte {
241
244
// SetVar sets the host variable associated with `key` to the `value` byte slice.
242
245
func SetVar (key string , value []byte ) {
243
246
keyMem := AllocateBytes ([]byte (key ))
244
- defer keyMem .Free ()
247
+ // TODO: coordinate replacement of call to free based on SDK alignment
248
+ // defer keyMem.Free()
245
249
246
250
valMem := AllocateBytes (value )
247
- defer valMem .Free ()
251
+ // TODO: coordinate replacement of call to free based on SDK alignment
252
+ // defer valMem.Free()
248
253
249
254
extismVarSet (keyMem .offset , valMem .offset )
250
255
}
@@ -269,21 +274,24 @@ func GetVarInt(key string) int {
269
274
// SetVarInt sets the host variable associated with `key` to the `value` int.
270
275
func SetVarInt (key string , value int ) {
271
276
keyMem := AllocateBytes ([]byte (key ))
272
- defer keyMem .Free ()
277
+ // TODO: coordinate replacement of call to free based on SDK alignment
278
+ // defer keyMem.Free()
273
279
274
280
bytes := make ([]byte , 8 )
275
281
binary .LittleEndian .PutUint64 (bytes , uint64 (value ))
276
282
277
283
valMem := AllocateBytes (bytes )
278
- defer valMem .Free ()
284
+ // TODO: coordinate replacement of call to free based on SDK alignment
285
+ // defer valMem.Free()
279
286
280
287
extismVarSet (keyMem .offset , valMem .offset )
281
288
}
282
289
283
290
// RemoveVar removes (and frees) the host variable associated with `key`.
284
291
func RemoveVar (key string ) {
285
292
mem := AllocateBytes ([]byte (key ))
286
- defer mem .Free ()
293
+ // TODO: coordinate replacement of call to free based on SDK alignment
294
+ // defer mem.Free()
287
295
extismVarSet (mem .offset , 0 )
288
296
}
289
297
0 commit comments