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

Refactor Rc and Arc to use a prefix allocator #84338

Closed
wants to merge 22 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
3070db1
Add Allocator-helper to allocate prefix and safety-tester
TimDiekmann Apr 19, 2021
8293713
Restructure `Rc` and `Arc` metadata for uniform access via a PrefixAlloc
TimDiekmann Apr 19, 2021
fba9038
Fix parameter order for allocator
TimDiekmann Apr 20, 2021
4b0dafd
Refactor `Rc` to use `PrefixAllocator` and store pointer to `T` directly
TimDiekmann Apr 21, 2021
596585a
Fix `PrefixAllocator` test
TimDiekmann Apr 21, 2021
c4d6ec7
Remove debug assertions in `get_mut_unchecked`
TimDiekmann Apr 21, 2021
e2b4562
Fix debug output
TimDiekmann Apr 22, 2021
19a813e
Satisfy tidy
TimDiekmann Apr 22, 2021
87ee732
Use `AllocInit` from allocation helpers in `raw_vec.rs`
TimDiekmann Apr 22, 2021
1c43985
Use `sizeof` instead of `alignof` in Debugger`
TimDiekmann Apr 22, 2021
ab40083
Satisfy rustfmt
TimDiekmann Apr 22, 2021
40261fd
Refactor `Arc` to use `PrefixAllocator` internally
TimDiekmann Apr 22, 2021
bcbba9c
Fix inlining for `fn metadata` and move out allocator call
TimDiekmann Apr 26, 2021
a50bef2
Add panic message for PrefixAllocator offset test
TimDiekmann Apr 26, 2021
5fc162f
Merge branch 'master' into unify_box_rc
TimDiekmann Apr 28, 2021
3de15d9
Merge branch 'master' into unify_box_rc
TimDiekmann May 23, 2021
251d44f
Fix messed up merge from GitHub
TimDiekmann May 23, 2021
0dc2769
Fix regression for `Rc` and `Arc`
TimDiekmann May 24, 2021
42fe0b9
Fix test for `PrefixAllocator::prefix` to use the non-generic version
TimDiekmann May 24, 2021
2cbdee6
Add missing cfg-attributes for no-global-oom-handling in `Rc` and `Arc`
TimDiekmann May 24, 2021
7944de5
Satisfy tidy...
TimDiekmann May 24, 2021
a4b4fe4
Simplify allocation for `Rc` and `Arc` to speed up optimization path
TimDiekmann May 25, 2021
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
1 change: 1 addition & 0 deletions library/alloc/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@
#![cfg_attr(test, feature(test))]
#![cfg_attr(test, feature(new_uninit))]
#![feature(allocator_api)]
#![feature(allocator_api_internals)]
#![feature(array_chunks)]
#![feature(array_methods)]
#![feature(array_windows)]
Expand Down
10 changes: 2 additions & 8 deletions library/alloc/src/raw_vec.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#![unstable(feature = "raw_vec_internals", reason = "implementation detail", issue = "none")]
#![doc(hidden)]

#[cfg(not(no_global_oom_handling))]
use core::alloc::helper::AllocInit;
use core::alloc::LayoutError;
use core::cmp;
use core::intrinsics;
Expand All @@ -18,14 +20,6 @@ use crate::collections::TryReserveError::{self, *};
#[cfg(test)]
mod tests;

#[cfg(not(no_global_oom_handling))]
enum AllocInit {
/// The contents of the new memory are uninitialized.
Uninitialized,
/// The new memory is guaranteed to be zeroed.
Zeroed,
}

/// A low-level utility for more ergonomically allocating, reallocating, and deallocating
/// a buffer of memory on the heap without having to worry about all the corner cases
/// involved. This type is excellent for building your own data structures like Vec and VecDeque.
Expand Down
Loading