Skip to content

Reimplement the most important structs and traits for testing #19

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

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
target
Cargo.lock
5 changes: 5 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[package]
authors = ["The Allocators WG"]
name = "wg-allocators"
version = "0.0.0"
edition = "2018"
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,17 @@ To be notified of every issue and pull request in this repository, try GitHub’

For lower-latency discussion, we have the [`t-libs/wg-allocators`] stream on Zulip.

## Code

In order to test different features, we mirrored some code from [rust-lang/rust].
Currently, this includes `Alloc`, `AllocErr`, `CannotRealocInPlace`, `Excess`, `Layout`, `LayoutErr`, `Global` and `Box`.
Additionally, the following functions are adjusted to work with our `Layout`: `alloc`, `alloc_zeroed`, `dealloc`, `realloc`, and `handle_alloc_error`.

However, a few things had to be adjusted to match the `alloc` crate as soon as possible:
- the `Drop` trait of `Box` calls `box_free` directly.
- for `Fn`, `FnOnce`, `FnMut`, and `FnBox` `F` has to implement `Copy`

[rust-lang/rust]: https://github.com/rust-lang/rust
[`std::alloc::Alloc`]: https://doc.rust-lang.org/1.34.0/std/alloc/trait.Alloc.html
[RFC #1398]: https://github.com/rust-lang/rfcs/pull/1398 "Allocators, take III"
[tracking issue #32838]: https://github.com/rust-lang/rust/issues/32838 "Allocator traits and std::heap"
Expand Down
Loading