Skip to content
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

Implement support for the new memory allocation API #427

Merged
merged 2 commits into from Dec 11, 2019
Merged

Conversation

axic
Copy link
Member

@axic axic commented Dec 9, 2019

No description provided.

wrapper.js Outdated Show resolved Hide resolved
wrapper.js Outdated Show resolved Hide resolved
@coveralls
Copy link

coveralls commented Dec 9, 2019

Coverage Status

Coverage decreased (-0.3%) to 83.85% when pulling be3195f on new-memory-api into a96ff26 on master_060.

wrapper.js Show resolved Hide resolved
wrapper.js Show resolved Hide resolved
wrapper.js Outdated Show resolved Hide resolved
wrapper.js Outdated
// The duty is on solc-js to free these pointers. We accomplish that by calling `reset` at the end.
var buffer;
if (isVersion6) {
buffer = alloc(length + 1);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To complement my comment on the solidity PR: We can just use alloc(length) here, while still passing length + 1 to stringToUTF8 below and it's guaranteed to be valid, while then the std::string on the solidity side won't contain an additional zero.

@axic axic merged commit 2297b30 into master_060 Dec 11, 2019
@axic axic deleted the new-memory-api branch December 11, 2019 15:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants