Skip to content

Commit 8858cce

Browse files
authored
Merge pull request #480 from metrico/precise_gc
feat: use tiny-go precise GC
2 parents 91a0daf + e17e732 commit 8858cce

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

wasm_parts/main.go

+5-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,11 @@ var data = map[uint32]*ctx{}
3333

3434
//export createCtx
3535
func createCtx(id uint32) {
36-
data[id] = &ctx{}
36+
ctxId := gcContext.GetContextID()
37+
gcContext.SetContext(id)
38+
c := &ctx{}
39+
gcContext.SetContext(ctxId)
40+
data[id] = c
3741
}
3842

3943
//export alloc

wasm_parts/main.wasm.gz

2.81 KB
Binary file not shown.

0 commit comments

Comments
 (0)