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

Update Allocator trait implementation to compile on nightly #95

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

rusty122
Copy link

Fixes issue #94

The wee_alloc build has been broken for a bit because the Rust Allocator (previously called Alloc) trait has changed interfaces. This PR updates the wee_alloc implementation to compile and run on nightly.

There are probably some more cleanup possible and different testing possibilities with the new interface, but I tried to make the minimal changes necessary to fix the build and unblock other contributions.

Some functions and methods that are still experimental I implemented as helper-functions to avoid requiring nightly for the library, but left TODO comments to update once they stabilize.

Haven't made a ton of Rust contributions so let me know if I missed anything here!

Ran `cargo fmt` and renamed AllocErr to AllocError. The main rename
was updating the Alloc trait (now the Allocator trait) and
associated methods.
Includes more renaming missed in the previous commit.
The allocate method needs to return a NonNull<[u8]>, so this commit
updates bunch of callsites to handle the returned allocation correctly.
Also cleaned up some alignment asserts for consistency (0 is not a power
of 2, so some of the existing asserts were extraneous).
@rusty122
Copy link
Author

cc @pepyakin @DrGoldfire @ZackPierce if anyone can review

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

1 participant