From 6c425d7a3596f1ed10fb3b281a3c473479b200b2 Mon Sep 17 00:00:00 2001 From: Arnaud Date: Fri, 6 Dec 2024 17:29:39 +0100 Subject: [PATCH] Add gcsafe pragma Signed-off-by: Arnaud --- datastore/datastore.nim | 16 ++++++++-------- datastore/mountedds.nim | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/datastore/datastore.nim b/datastore/datastore.nim index 47f339b..b038165 100644 --- a/datastore/datastore.nim +++ b/datastore/datastore.nim @@ -16,22 +16,22 @@ type Modify* = Function[?seq[byte], Future[?seq[byte]]] ModifyGet* = Function[?seq[byte], Future[(?seq[byte], seq[byte])]] -method has*(self: Datastore, key: Key): Future[?!bool] {.base, locks: "unknown".} = +method has*(self: Datastore, key: Key): Future[?!bool] {.base, gcsafe, locks: "unknown".} = raiseAssert("Not implemented!") -method delete*(self: Datastore, key: Key): Future[?!void] {.base, locks: "unknown".} = +method delete*(self: Datastore, key: Key): Future[?!void] {.base, gcsafe, locks: "unknown".} = raiseAssert("Not implemented!") -method delete*(self: Datastore, keys: seq[Key]): Future[?!void] {.base, locks: "unknown".} = +method delete*(self: Datastore, keys: seq[Key]): Future[?!void] {.base, gcsafe, locks: "unknown".} = raiseAssert("Not implemented!") -method get*(self: Datastore, key: Key): Future[?!seq[byte]] {.base, locks: "unknown".} = +method get*(self: Datastore, key: Key): Future[?!seq[byte]] {.base, gcsafe, locks: "unknown".} = raiseAssert("Not implemented!") -method put*(self: Datastore, key: Key, data: seq[byte]): Future[?!void] {.base, locks: "unknown".} = +method put*(self: Datastore, key: Key, data: seq[byte]): Future[?!void] {.base, gcsafe, locks: "unknown".} = raiseAssert("Not implemented!") -method put*(self: Datastore, batch: seq[BatchEntry]): Future[?!void] {.base, locks: "unknown".} = +method put*(self: Datastore, batch: seq[BatchEntry]): Future[?!void] {.base, gcsafe, locks: "unknown".} = raiseAssert("Not implemented!") method close*(self: Datastore): Future[?!void] {.base, async, locks: "unknown".} = @@ -46,7 +46,7 @@ method query*( proc contains*(self: Datastore, key: Key): Future[bool] {.async.} = return (await self.has(key)) |? false -method modify*(self: Datastore, key: Key, fn: Modify): Future[?!void] {.base, locks: "unknown".} = +method modify*(self: Datastore, key: Key, fn: Modify): Future[?!void] {.base, gcsafe, locks: "unknown".} = ## Concurrently safe way of modifying the value associated with the `key`. ## ## Same as `modifyGet`, but this takes `fn` that doesn't produce any auxillary value. @@ -54,7 +54,7 @@ method modify*(self: Datastore, key: Key, fn: Modify): Future[?!void] {.base, lo raiseAssert("Not implemented!") -method modifyGet*(self: Datastore, key: Key, fn: ModifyGet): Future[?!seq[byte]] {.base, locks: "unknown".} = +method modifyGet*(self: Datastore, key: Key, fn: ModifyGet): Future[?!seq[byte]] {.base, gcsafe, locks: "unknown".} = ## Concurrently safe way of updating value associated with the `key`. Returns auxillary value on ## successful update. ## diff --git a/datastore/mountedds.nim b/datastore/mountedds.nim index d1c51cd..5be8511 100644 --- a/datastore/mountedds.nim +++ b/datastore/mountedds.nim @@ -20,7 +20,7 @@ type MountedDatastore* = ref object of Datastore stores*: Table[Key, MountedStore] -method mount*(self: MountedDatastore, key: Key, store: Datastore): ?!void {.base.} = +method mount*(self: MountedDatastore, key: Key, store: Datastore): ?!void {.base, gcsafe.} = ## Mount a store on a namespace - namespaces are only `/` ##