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

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 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.

1 participant