Skip to content

Commit 4d9971e

Browse files
authored
Merge pull request #37410 from mikeash/job-metadata-debug-symbol
[Concurrency] Expose Job's metadata as a debug variable
2 parents 8a41c59 + e4a1d2b commit 4d9971e

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

stdlib/public/Concurrency/Debug.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,13 @@
2121

2222
namespace swift {
2323

24+
// Dispatch knows about these symbol names. Don't change them without consulting
25+
// dispatch.
26+
27+
/// The metadata pointer used for job objects.
28+
SWIFT_RUNTIME_STDLIB_SPI
29+
const void *const _swift_concurrency_debug_jobMetadata;
30+
2431
/// The metadata pointer used for async task objects.
2532
SWIFT_RUNTIME_STDLIB_SPI
2633
const void *const _swift_concurrency_debug_asyncTaskMetadata;

stdlib/public/Concurrency/Task.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -273,6 +273,8 @@ static FullMetadata<DispatchClassMetadata> taskHeapMetadata = {
273273
}
274274
};
275275

276+
const void *const swift::_swift_concurrency_debug_jobMetadata =
277+
static_cast<Metadata *>(&jobHeapMetadata);
276278
const void *const swift::_swift_concurrency_debug_asyncTaskMetadata =
277279
static_cast<Metadata *>(&taskHeapMetadata);
278280

0 commit comments

Comments
 (0)