chore: orc support (#110)

Support ORC memory model (https://github.com/logos-storage/logos-storage-nim-dht/issues/109)

Signed-off-by: Chrysostomos Nanakos <chris@include.gr>
This commit is contained in:
Chrysostomos Nanakos 2025-12-23 23:23:31 +02:00 committed by GitHub
parent 99884b5971
commit 754765ba31
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 11 additions and 8 deletions

View File

@ -1,6 +1,6 @@
# Package # Package
version = "0.5.0" version = "0.6.0"
author = "Status Research & Development GmbH" author = "Status Research & Development GmbH"
description = "DHT based on Eth discv5 implementation" description = "DHT based on Eth discv5 implementation"
license = "MIT" license = "MIT"

View File

@ -524,10 +524,16 @@ proc len*(r: RoutingTable): int =
proc moveRight[T](arr: var openArray[T], a, b: int) = proc moveRight[T](arr: var openArray[T], a, b: int) =
## In `arr` move elements in range [a, b] right by 1. ## In `arr` move elements in range [a, b] right by 1.
var t: T var t: T
shallowCopy(t, arr[b + 1]) when declared(shallowCopy):
for i in countdown(b, a): shallowCopy(t, arr[b + 1])
shallowCopy(arr[i + 1], arr[i]) for i in countdown(b, a):
shallowCopy(arr[a], t) shallowCopy(arr[i + 1], arr[i])
shallowCopy(arr[a], t)
else:
t = move arr[b + 1]
for i in countdown(b, a):
arr[i + 1] = move arr[i]
arr[a] = move t
proc setJustSeen*(r: RoutingTable, n: Node, seen = true) = proc setJustSeen*(r: RoutingTable, n: Node, seen = true) =
## If seen, move `n` to the head (most recently seen) of its bucket. ## If seen, move `n` to the head (most recently seen) of its bucket.

View File

@ -4,6 +4,3 @@ switch("define", "libp2p_pki_schemes=secp256k1")
when withDir(thisDir(), system.fileExists("nimble.paths")): when withDir(thisDir(), system.fileExists("nimble.paths")):
include "nimble.paths" include "nimble.paths"
# end Nimble config # end Nimble config
when (NimMajor, NimMinor) >= (2, 0):
--mm:refc