From 917fc50a3f6325684907b33b2d69f6345a93e22b Mon Sep 17 00:00:00 2001 From: Jake Leahy Date: Tue, 7 Feb 2023 10:24:15 +1100 Subject: [PATCH 1/2] Annotate body proc as needing to be gcsafe --- ndb/sqlite.nim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ndb/sqlite.nim b/ndb/sqlite.nim index 9507fcf..04acbe2 100644 --- a/ndb/sqlite.nim +++ b/ndb/sqlite.nim @@ -239,7 +239,7 @@ proc bindArgs(db: DbConn, stmt: var sqlite3.Pstmt, query: SqlQuery, return true proc tryWithStmt(db: DbConn, query: SqlQuery, args: seq[DbValue], - body: proc(stmt: Pstmt): bool {.raises: [], tags: [].}): bool = + body: proc(stmt: Pstmt): bool {.raises: [], tags: [], gcsafe.}): bool = ## A common template dealing with statement initialization and finalization: ## ## 1. Initialize a statement. From 774413a00efe89e05fe9ac477c8eca7b2a3f6277 Mon Sep 17 00:00:00 2001 From: Jake Leahy Date: Wed, 8 Feb 2023 13:36:41 +1100 Subject: [PATCH 2/2] Add gcsafe pragma for postgres also --- ndb/postgres.nim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ndb/postgres.nim b/ndb/postgres.nim index 2a3b1b3..40ae43f 100644 --- a/ndb/postgres.nim +++ b/ndb/postgres.nim @@ -221,7 +221,7 @@ proc dbError*(db: DbConn) {.noreturn.} = proc tryWithStmt(db: DbConn, query: SqlQuery, args: seq[DbValue], expectedStatusType: ExecStatusType, - body: proc(res: PPGresult): bool {.raises: [], tags: [].}): bool = + body: proc(res: PPGresult): bool {.raises: [], tags: [], gcsafe.}): bool = ## A common template dealing with statement initialization and finalization: ## ## 1. Initialize a statement.