[wip] use copyMem instead of moveMem

This commit is contained in:
Michael Bradley, Jr 2022-03-23 12:32:58 -05:00
parent 3592d7ac7f
commit b947334824
No known key found for this signature in database
GPG Key ID: 9FCA591DA4CE7D0D

View File

@ -169,7 +169,7 @@ proc encode*(code: ReedSolomonCode, data: Data):
msg: LeopardInconsistentSizeMsg) msg: LeopardInconsistentSizeMsg)
enData[i] = allocAligned(symbolBytes, LEO_ALIGN_BYTES) enData[i] = allocAligned(symbolBytes, LEO_ALIGN_BYTES)
moveMem(enData[i], addr data[i][0], symbolBytes) copyMem(enData[i], addr data[i][0], symbolBytes)
let let
workCount = leoEncodeWorkCount(code.data.cuint, code.parity.cuint) workCount = leoEncodeWorkCount(code.data.cuint, code.parity.cuint)
@ -207,7 +207,7 @@ proc encode*(code: ReedSolomonCode, data: Data):
newSeq(parityData, code.parity) newSeq(parityData, code.parity)
for i in 0..<code.parity: for i in 0..<code.parity:
newSeq(parityData[i], symbolBytes) newSeq(parityData[i], symbolBytes)
moveMem(addr parityData[i][0], workData[i], symbolBytes) copyMem(addr parityData[i][0], workData[i], symbolBytes)
for i in 0..<code.data: freeAligned enData[i] for i in 0..<code.data: freeAligned enData[i]
for i in 0..<workCount: freeAligned workData[i] for i in 0..<workCount: freeAligned workData[i]
@ -255,7 +255,7 @@ proc decode*(code: ReedSolomonCode, data: Data, parityData: ParityData,
msg: LeopardInconsistentSizeMsg) msg: LeopardInconsistentSizeMsg)
deData[i] = allocAligned(symbolBytes.int, LEO_ALIGN_BYTES) deData[i] = allocAligned(symbolBytes.int, LEO_ALIGN_BYTES)
moveMem(deData[i], addr data[i][0], symbolBytes) copyMem(deData[i], addr data[i][0], symbolBytes)
else: else:
holes.add i.int holes.add i.int
@ -276,7 +276,7 @@ proc decode*(code: ReedSolomonCode, data: Data, parityData: ParityData,
msg: LeopardInconsistentSizeMsg) msg: LeopardInconsistentSizeMsg)
paData[i] = allocAligned(symbolBytes.int, LEO_ALIGN_BYTES) paData[i] = allocAligned(symbolBytes.int, LEO_ALIGN_BYTES)
moveMem(paData[i], addr parityData[i][0], symbolBytes) copyMem(paData[i], addr parityData[i][0], symbolBytes)
let let
workCount = leoDecodeWorkCount(code.data.cuint, code.parity.cuint) workCount = leoDecodeWorkCount(code.data.cuint, code.parity.cuint)
@ -317,7 +317,7 @@ proc decode*(code: ReedSolomonCode, data: Data, parityData: ParityData,
newSeq(recoveredData, workCount) newSeq(recoveredData, workCount)
for i in 0..<workCount: for i in 0..<workCount:
newSeq(recoveredData[i], symbolBytes) newSeq(recoveredData[i], symbolBytes)
moveMem(addr recoveredData[i][0], workData[i], symbolBytes) copyMem(addr recoveredData[i][0], workData[i], symbolBytes)
for i in holes: for i in holes:
data[i] = recoveredData[i] data[i] = recoveredData[i]