mirror of
https://github.com/logos-storage/logos-storage-nim-dht.git
synced 2026-01-02 05:23:12 +00:00
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:
parent
99884b5971
commit
754765ba31
@ -1,6 +1,6 @@
|
||||
# Package
|
||||
|
||||
version = "0.5.0"
|
||||
version = "0.6.0"
|
||||
author = "Status Research & Development GmbH"
|
||||
description = "DHT based on Eth discv5 implementation"
|
||||
license = "MIT"
|
||||
|
||||
@ -524,10 +524,16 @@ proc len*(r: RoutingTable): int =
|
||||
proc moveRight[T](arr: var openArray[T], a, b: int) =
|
||||
## In `arr` move elements in range [a, b] right by 1.
|
||||
var t: T
|
||||
when declared(shallowCopy):
|
||||
shallowCopy(t, arr[b + 1])
|
||||
for i in countdown(b, a):
|
||||
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) =
|
||||
## If seen, move `n` to the head (most recently seen) of its bucket.
|
||||
|
||||
@ -4,6 +4,3 @@ switch("define", "libp2p_pki_schemes=secp256k1")
|
||||
when withDir(thisDir(), system.fileExists("nimble.paths")):
|
||||
include "nimble.paths"
|
||||
# end Nimble config
|
||||
|
||||
when (NimMajor, NimMinor) >= (2, 0):
|
||||
--mm:refc
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user