-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[Reflection] Add API for inspecting async task allocation slabs. #40071
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
[Reflection] Add API for inspecting async task allocation slabs. #40071
Conversation
@swift-ci please test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm!
template <size_t SlabCapacity> | ||
/// | ||
/// SlabMetadataPtr specifies a fake metadata pointer to place at the beginning | ||
/// of slaba llocations, so analysis tools can identify them. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
... slab allocations ...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, good catch.
831c1b6
to
7133a59
Compare
@swift-ci please test |
We remove the existing `swift_reflection_iterateAsyncTaskAllocations` API that attempts to provide all necessary information about a tasks's allocations starting from the task. Instead, we split it into two pieces: `swift_reflection_asyncTaskSlabPointer` to get the first slab for a task, and `+swift_reflection_asyncTaskSlabAllocations` to get the allocations in a slab, and a pointer to the next slab. We also add a dummy metadata pointer to the beginning of each slab. This allows tools to identify slab allocations on the heap without needing to locate every single async task object. They can then use `swift_reflection_asyncTaskSlabAllocations` on such allocations to find out about the contents. rdar://82549631
7133a59
to
7c7dc5d
Compare
@swift-ci please test |
Build failed |
@swift-ci please test |
We remove the existing
swift_reflection_iterateAsyncTaskAllocations
API that attempts to provide all necessary information about a tasks's allocations starting from the task. Instead, we split it into two pieces:swift_reflection_asyncTaskSlabPointer
to get the first slab for a task, and+swift_reflection_asyncTaskSlabAllocations
to get the allocations in a slab, and a pointer to the next slab.We also add a dummy metadata pointer to the beginning of each slab. This allows tools to identify slab allocations on the heap without needing to locate every single async task object. They can then use
swift_reflection_asyncTaskSlabAllocations
on such allocations to find out about the contents.rdar://82549631