From b0beb062d443b55c36f4958d7014bf07a73a6e6d Mon Sep 17 00:00:00 2001 From: inv2004 <> Date: Wed, 20 Sep 2023 00:09:40 +0300 Subject: [PATCH] mark bson.encode/decode gcsafe --- src/anonimongo/core/bson.nim | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/anonimongo/core/bson.nim b/src/anonimongo/core/bson.nim index ea5d569..7301ef1 100644 --- a/src/anonimongo/core/bson.nim +++ b/src/anonimongo/core/bson.nim @@ -678,7 +678,7 @@ proc writeKey(s: var Streamable, key: string, kind: BsonKind): int32 = s.write 0x00.byte result = int32(1 + key.len + 1) -proc encode*(doc: BsonDocument): (int, string) +proc encode*(doc: BsonDocument): (int, string) {.gcsafe.} proc encode(s: var Streamable, key: string, doc: BsonInt32): int = result = s.writeKey(key, bkInt32) + doc.value.sizeof @@ -904,7 +904,7 @@ proc decodeKey(s: var Streamable): (string, BsonKind) = buff &= achar result = (buff, kind) -proc decode*(strbytes: string): BsonDocument +proc decode*(strbytes: string): BsonDocument {.gcsafe.} proc decodeArray(s: var Streamable): seq[BsonBase] = let length = s.peekInt32LE