remove some dead code
This commit is contained in:
parent
41d022b7fa
commit
6bd09b1bba
|
@ -99,12 +99,6 @@ proc hash(d: Dispatcher): int =
|
||||||
proc `==`(lhs, rhs: Dispatcher): bool =
|
proc `==`(lhs, rhs: Dispatcher): bool =
|
||||||
lhs.protocolOffsets == rhs.protocolOffsets
|
lhs.protocolOffsets == rhs.protocolOffsets
|
||||||
|
|
||||||
template totalThunks(d: Dispatcher): int =
|
|
||||||
d.thunks.len
|
|
||||||
|
|
||||||
template getThunk(d: Dispatcher, idx: int): MessageHandler =
|
|
||||||
rlpxProtocols.thunks[idx]
|
|
||||||
|
|
||||||
proc describeProtocols(d: Dispatcher): string =
|
proc describeProtocols(d: Dispatcher): string =
|
||||||
result = ""
|
result = ""
|
||||||
for i in 0 ..< rlpxProtocols.len:
|
for i in 0 ..< rlpxProtocols.len:
|
||||||
|
@ -658,11 +652,13 @@ when isMainModule:
|
||||||
var p = Peer()
|
var p = Peer()
|
||||||
discard p.bar(10, "test")
|
discard p.bar(10, "test")
|
||||||
|
|
||||||
when false:
|
when true:
|
||||||
# The assignment below can be used to investigate if the RLPx procs
|
# The assignments below can be used to investigate if the RLPx procs
|
||||||
# are considered GcSafe. The short answer is that they aren't, because
|
# are considered GcSafe. The short answer is that they aren't, because
|
||||||
# they dispatch into user code that might use the GC.
|
# they dispatch into user code that might use the GC.
|
||||||
type
|
type
|
||||||
|
GcSafeDispatchMsg = proc (peer: Peer, msgId: int, msgData: var Rlp)
|
||||||
|
|
||||||
GcSafeRecvMsg = proc (peer: Peer):
|
GcSafeRecvMsg = proc (peer: Peer):
|
||||||
Future[tuple[msgId: int, msgData: Rlp]] {.gcsafe.}
|
Future[tuple[msgId: int, msgData: Rlp]] {.gcsafe.}
|
||||||
|
|
||||||
|
@ -670,6 +666,7 @@ when isMainModule:
|
||||||
Future[Peer] {.gcsafe.}
|
Future[Peer] {.gcsafe.}
|
||||||
|
|
||||||
var
|
var
|
||||||
|
dispatchMsgPtr = dispatchMsg
|
||||||
recvMsgPtr: GcSafeRecvMsg = recvMsg
|
recvMsgPtr: GcSafeRecvMsg = recvMsg
|
||||||
acceptPtr: GcSafeAccept = rlpxAccept
|
acceptPtr: GcSafeAccept = rlpxAccept
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue