Skip to content
This repository was archived by the owner on Oct 12, 2022. It is now read-only.

Commit 7bccec6

Browse files
Modify GC.stats to allow requesting specific stats
1 parent f87aed9 commit 7bccec6

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/core/memory.d

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -680,8 +680,14 @@ struct GC
680680
/**
681681
* Returns runtime stats for currently active GC implementation
682682
* See `core.memory.GC.Stats` for list of available metrics.
683+
*
684+
* Params:
685+
* fields = optional bit flag argument which specifies which stats need
686+
* to be calculated. By default equals to "all fields". If some field
687+
* was not requested via bit flag, its value in returned `Stats` struct
688+
* will be undefined.
683689
*/
684-
static Stats stats() nothrow
690+
static Stats stats(ulong fields = ulong.max) nothrow
685691
{
686692
return gc_stats(ulong.max);
687693
}

0 commit comments

Comments
 (0)