mirror of
https://github.com/logos-storage/nim-groth16.git
synced 2026-02-11 09:13:06 +00:00
applies gc-safety to zkey parser
This commit is contained in:
parent
bbfb4d5f7f
commit
3ff657db48
@ -61,8 +61,8 @@ proc readSection[T] ( expectedMagic: string
|
||||
, stream: Stream
|
||||
, user: var T
|
||||
, callback: SectionCallback[T]
|
||||
, filt: proc(_: int): bool {.raises: [IOError, OSError].}
|
||||
) {.raises: [IOError, OSError].} =
|
||||
, filt: proc(_: int): bool {.gcsafe, raises: [IOError, OSError].}
|
||||
) {.gcsafe, raises: [IOError, OSError].} =
|
||||
|
||||
let sectId = int( stream.readUint32() )
|
||||
let sectLen = int( stream.readUint64() )
|
||||
@ -78,7 +78,7 @@ proc parseContainer*[T] ( expectedMagic: string
|
||||
, fname: string
|
||||
, user: var T
|
||||
, callback: SectionCallback[T]
|
||||
, filt: proc(_: int): bool {.raises: [IOError, OSError].}
|
||||
, filt: proc(_: int): bool {.gcsafe, raises: [IOError, OSError].}
|
||||
) {.raises: [IOError, OSError].} =
|
||||
|
||||
let stream = newFileStream(fname, mode = fmRead)
|
||||
|
||||
@ -238,7 +238,7 @@ proc zkeyCallback(stream: Stream, sectId: int, sectLen: int, user: var ZKey) =
|
||||
of 9: parseSection9_PointsH1( stream, user, sectLen )
|
||||
else: discard
|
||||
|
||||
proc parseZKey* (fname: string): ZKey =
|
||||
proc parseZKey* (fname: string): ZKey {.gcsafe.} =
|
||||
var zkey : ZKey
|
||||
parseContainer( "zkey", 1, fname, zkey, zkeyCallback, proc (id: int): bool = id == 1 )
|
||||
parseContainer( "zkey", 1, fname, zkey, zkeyCallback, proc (id: int): bool = id == 2 )
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user