Skip to content

Commit fec2c20

Browse files
committed
chore: allocate cells onto heap instead of unboxing arrays
1 parent 2d333bf commit fec2c20

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

bindings/c/src/compute_cells_and_kzg_proofs.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ pub(crate) fn _compute_cells_and_kzg_proofs(
2020
let (cells, proofs) = ctx
2121
.compute_cells_and_kzg_proofs(blob)
2222
.map_err(|err| CResult::with_error(&format!("{:?}", err)))?;
23-
let cells_unboxed = cells.map(|cell| *cell);
23+
let cells_unboxed = cells.map(|cell| cell.to_vec());
2424

2525
// Write to output
2626
write_to_2d_slice::<_, CELLS_PER_EXT_BLOB>(out_cells, cells_unboxed);

bindings/c/src/recover_cells_and_kzg_proofs.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,7 @@ pub(crate) fn _recover_all_cells_and_proofs(
2626
let (recovered_cells, recovered_proofs) = ctx
2727
.recover_cells_and_proofs(cell_ids.to_vec(), cells, vec![])
2828
.map_err(|err| CResult::with_error(&format!("{:?}", err)))?;
29-
// TODO: Ideally would like to avoid unboxing Cells since they are quite large.
30-
let recovered_cells_unboxed = recovered_cells.map(|cell| *cell);
29+
let recovered_cells_unboxed = recovered_cells.map(|cell| cell.to_vec());
3130

3231
// Write to output
3332
write_to_2d_slice::<_, CELLS_PER_EXT_BLOB>(out_cells, recovered_cells_unboxed);

0 commit comments

Comments
 (0)