Skip to main content

swift_runtime/
debug.rs

1//! Runtime debug variable accessors.
2//!
3//! These provide access to Swift runtime debugging facilities.
4//! Some variables are only available on Swift 6.3+ runtimes.
5
6/// Metadata allocation pool size (Swift 6.3+).
7/// Returns `None` on older runtimes.
8pub fn allocation_pool_size() -> Option<usize> {
9    swift_runtime_sys::DebugVars::debug_allocationPoolSize()
10}
11
12/// Metadata allocator page size (Swift 6.3+).
13/// Returns `None` on older runtimes.
14pub fn metadata_allocator_page_size() -> Option<usize> {
15    swift_runtime_sys::DebugVars::debug_metadataAllocatorPageSize()
16}
17
18/// Whether the concurrency task slab allocator is enabled (Swift 6.3+).
19/// Returns `None` on older runtimes.
20pub fn task_slab_allocator_enabled() -> Option<bool> {
21    swift_runtime_sys::DebugVars::debug_concurrencyEnableTaskSlabAllocator()
22}