Skip to content

Commit

Permalink
update trealla, eagerly close wasm instance
Browse files Browse the repository at this point in the history
  • Loading branch information
guregu committed Sep 8, 2024
1 parent d71bd64 commit f9b6d13
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/trealla
Binary file modified trealla/libtpl.wasm
Binary file not shown.
5 changes: 3 additions & 2 deletions trealla/prolog.go
Original file line number Diff line number Diff line change
Expand Up @@ -205,8 +205,6 @@ func (pl *prolog) init(parent *prolog) error {
pl.spawning = make(map[uint32]*query)

pl.procs = maps.Clone(parent.procs)
// pl.procs[piTerm("$coro_next", 2).String()] = pl.sys_coro_next_2
// pl.procs[piTerm("$coro_stop", 1).String()] = pl.sys_coro_stop_1
pl.coros = make(map[int64]coroutine) // TODO: copy over? probably not

pl.dirs = parent.dirs
Expand Down Expand Up @@ -337,6 +335,9 @@ func (pl *prolog) subquery(addr uint32) *query {
func (pl *prolog) Close() {
pl.mu.Lock()
defer pl.mu.Unlock()
if pl.instance != nil {
pl.instance.Close(context.Background())
}
pl.instance = nil
pl.memory = nil
}
Expand Down

0 comments on commit f9b6d13

Please sign in to comment.