Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR
Vec<A>
toocaml::Array<B>
in rustVec<A> -> Vec<B>
and falls back on the implicitVec<B> -> ocaml::Array<B>
conversionThis appears to fix a memory corruption issue, where a bad allocation for a polynomial commitment could cause a
Fatal error: out of memory
message. The tool I wrote to find the bug would consistently trigger this in < 5000 iterations on the old version; the new version still hasn't after 200,000 (test still running).I'm not clear on why this fixes the issue: the underlying logic for the two versions is nearly identical, save for an extra (presumably unnecessary) vector allocation in the new version. However, in the old version the compiler seems to optimise away some writes that are needed to tell the OCaml GC about some live heap memory; in the new version these writes appear happen successfully.
Checklist:
This fixes #6674