Skip to content
This repository was archived by the owner on Aug 25, 2025. It is now read-only.

Conversation

Mirclus
Copy link
Contributor

@Mirclus Mirclus commented Feb 12, 2018

Based on the implementation in dlmalloc-rs.

I'm not sure how to handle the error case. Panic? I didn't change the behavior for now.

Also, if I understand the Intrinsic correctly, both input parameter and return value should have the same type. Dlmalloc doesn't follow this either, but it uses a fixed size for the argument. I'm not really sure if this is something that should get changed.

Should fix #16.

Copy link
Member

@fitzgen fitzgen left a comment

Choose a reason for hiding this comment

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

Thanks!

We can go ahead and land this now, panicking is fine since that is what we currently do.

However, now that we can check for failure, we can also modify the alloc_pages signature so that the function returns Result<*mut u8, ()> (here and in imp_unix.rs) and properly return and propagate errors.

Interested in doing this as a follow up PR as well?

@fitzgen fitzgen merged commit cbf738f into rustwasm:master Feb 12, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Rust upgrade to LLVM6 breaks wee_alloc

2 participants