Reentrant arenas.

This commit is contained in:
Nuno Cruces
2023-11-29 10:38:03 +00:00
parent 997e197f54
commit 9bf14becaf
8 changed files with 41 additions and 33 deletions

View File

@@ -208,10 +208,10 @@ func (ctx Context) ResultError(err error) {
msg, code := errorCode(err, _OK)
if msg != "" {
ptr := ctx.c.newString(msg)
defer ctx.c.arena.mark()()
ptr := ctx.c.arena.string(msg)
ctx.c.call(ctx.c.api.resultError,
uint64(ctx.handle), uint64(ptr), uint64(len(msg)))
ctx.c.free(ptr)
}
if code != _OK {
ctx.c.call(ctx.c.api.resultErrorCode,