Fix multiple errors in Chia related changes to relic if ALLOC!=AUTO #36
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.
These are mostly compilation errors and a few fixes for memory leaks.
I encountered these while trying to build and test the library with ALLOC=DYNAMIC. This PR only fixes the issues which I found in the relic source. There are much more issues with the BLS library, but I'm not going to create a PR for those...these required much more changes. And instead of fixing the issues on that level, I'd suggest to implement small C++ wrappers around relic::bn_t, relic::ep_t and relic::ep2_t which do the appropriate relic::xxx_new/relic::xxx_free calls in constructors/destructors. This way you'd catch all possible memory leaks and clean up the code as well.
I decided to create this PR so that whenever you decide to backport the
ep_map
related changes to upstream, these changes are included.And FYI (not really related to this PR), the tests I did with ALLOC=DYNAMIC were a dead end. As expected, it got slower in single threaded environment, but my hope was that it would improve multithreaded environments, where currently parallel verification does not scale after about 4 threads on my system (with 8 cores). I assume that the issues I have with multithreading are in some way related to L1/L2 cache issues and as I had no idea how to fix this, I gave ALLOC=DYNAMIC a try to compare it ;)