-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
No alloc
experiment
#42
Closed
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
facebook-github-bot
added
the
CLA Signed
This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
label
Dec 19, 2021
Cherry-picked some commits that don't really belong here to #34. |
daxpedda
force-pushed
the
no-alloc
branch
2 times, most recently
from
December 22, 2021 13:00
ae6fa39
to
9fee5e1
Compare
Re-based and ready to review, the question remaining in the OP can be handled in a different PR too. |
Re-based. CI is fine, failed on downloading Rust. |
Merged by #44. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
CLA Signed
This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
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 adds support for removing the requirement for
alloc
from the crate. Following changes were introduced:GenericArray<u8, _>
instead ofVec<u8>
and requires somewhere
bounds, which shouldn't affect the user unless they are using a generic interface themselves.NonVerifiableClient
andVerifiableClient
don't hold data anymore, that way the user has to store the data and we don't have to bind our items by lifetimes. This also makes serialization without allocation possible, because we have a known size now. Alternatively we could either introduce a lifetimes to these items, or introduce a generic that can beAsRef<u8>
to own thedata
without allocation. Both would makeserialization
withoutalloc
support impossible or difficult.batch_evaluate
is now only supported withalloc
, because I have no clue how to support it without allocating memory to save the generatedEvaluationElement
s.batch_finalize
now returns anIterator
instead of aVec
.So the missing part to make it completely support building without
alloc
would be to split thebatch_evaluate
functions into two parts so output can be collected by the user without allocation. This is already done internally, so we can just make the interface public. We can still leave the originalbatch_evaluate
as a convenience function for users that have support foralloc
. What do you think @kevinlewi?This builds on top of #34.