From ef893170bcc9507089d53fbea9d7cf61d18f5fd9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C3=A9ter=20Garamv=C3=B6lgyi?= Date: Tue, 22 Aug 2023 06:01:16 +0200 Subject: [PATCH] fix: use correct CGo syntax for Free (#478) --- rollup/circuitcapacitychecker/impl.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rollup/circuitcapacitychecker/impl.go b/rollup/circuitcapacitychecker/impl.go index e55518a105..9f91d638bf 100644 --- a/rollup/circuitcapacitychecker/impl.go +++ b/rollup/circuitcapacitychecker/impl.go @@ -73,7 +73,7 @@ func (ccc *CircuitCapacityChecker) ApplyTransaction(traces *types.BlockTrace) (* log.Debug("start to check circuit capacity for tx", "id", ccc.ID, "TxHash", traces.Transactions[0].TxHash) rawResult := C.apply_tx(C.uint64_t(ccc.ID), tracesStr) defer func() { - C.free(rawResult) + C.free(unsafe.Pointer(rawResult)) }() log.Debug("check circuit capacity for tx done", "id", ccc.ID, "TxHash", traces.Transactions[0].TxHash) @@ -122,7 +122,7 @@ func (ccc *CircuitCapacityChecker) ApplyBlock(traces *types.BlockTrace) (*types. log.Debug("start to check circuit capacity for block", "id", ccc.ID, "blockNumber", traces.Header.Number, "blockHash", traces.Header.Hash()) rawResult := C.apply_block(C.uint64_t(ccc.ID), tracesStr) defer func() { - C.free(rawResult) + C.free(unsafe.Pointer(rawResult)) }() log.Debug("check circuit capacity for block done", "id", ccc.ID, "blockNumber", traces.Header.Number, "blockHash", traces.Header.Hash())