-
Notifications
You must be signed in to change notification settings - Fork 449
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
Allow option to opt-out of provided memory allocator #1661
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1661 +/- ##
==========================================
+ Coverage 70.72% 70.74% +0.01%
==========================================
Files 206 206
Lines 6416 6416
==========================================
+ Hits 4538 4539 +1
+ Misses 1878 1877 -1
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
examples/custom_allocator/lib.rs
Outdated
@@ -0,0 +1,180 @@ | |||
//! # Custom Allocator | |||
//! | |||
//! This example demonstrates how to opt-out of the ink! provided global memory allocator. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lemme be the guy commenting about something on the order of 80 CPL 😬 .
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we configure rustfmt
to catch this? I think it enforces code CPL to 100, not sure about the comments.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We already enforce this to 90 characters, which is what it's at 😉
Edit:
Actually, we should be enforcing comments as 80
So maybe there is something to look into here 🤔
But everything else is under 100 which is reasonable imo.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Just the nitpicks about having less CPL throughout.
Add the example to https://github.com/paritytech/ink-examples as well, please. |
Co-authored-by: Michael Müller <[email protected]>
This takes #1415 one step further and provides the
no-allocator
feature to the top levelink
crate, allowing contract authors to opt-outof the provided memory allocator.
It also adds an example showing how a contract author could provide their own allocator.
Closes #1414.
cc @kvinwang