-
Notifications
You must be signed in to change notification settings - Fork 63
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Correct some edge cases with Arc and Rc
Summary: - `Arc<dyn Trait>` now records pointer size correctly as 16 bytes - `Arc<CacheLine>` / other large-alignment types no longer under-report size of ArcInner/RcInner. Now they include the padding. - `triomphe::Arc<T>` now includes padding in the heap part for small T X-link: facebookexperimental/allocative#14 Reviewed By: JakobDegen Differential Revision: D66431445 Pulled By: ndmitchell fbshipit-source-id: aa0c05b2fae94898af21cbc206a79cd974073612
- Loading branch information
1 parent
20b1037
commit ddb3467
Showing
6 changed files
with
100 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# @generated | ||
# To regenerate, run: | ||
# ``` | ||
# ALLOCATIVE_REGENERATE_TESTS=1 cargo test -p allocative | ||
# ``` | ||
ArcInner 64 | ||
ArcInner;allocative::impls::std::sync::tests::CacheLine 63 | ||
ArcInner;allocative::impls::std::sync::tests::CacheLine;0;u8 1 | ||
alloc::sync::Arc<allocative::impls::std::sync::tests::CacheLine>;ptr 8 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# @generated | ||
# To regenerate, run: | ||
# ``` | ||
# ALLOCATIVE_REGENERATE_TESTS=1 cargo test -p allocative | ||
# ``` | ||
allocative::impls::triomphe::ArcInnerRepr 15 | ||
allocative::impls::triomphe::ArcInnerRepr;data;u8 1 | ||
triomphe::arc::Arc<u8>;ptr 8 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters