digitalmars.D.learn - Print debug data
- Alain De Vos (4/4) Jul 16 2023 Is it possible to print runtime memory usage of:
- Chris Katko (3/7) Jul 16 2023 there's gc.stats for part of it:
- devosalain (10/10) Jul 18 2023 ```
- Kagamin (1/1) Jul 18 2023 Naming is hard.
- Alain De Vos (1/1) Jul 18 2023 ?
- Steven Schveighoffer (7/8) Jul 18 2023 use `stats` instead of `Stats`.
- Dennis (8/10) Jul 20 2023 As of https://github.com/dlang/dmd/pull/15430, there's a new
- mw (3/7) Apr 24 And how to print the memory stats of each class / struct type?
Is it possible to print runtime memory usage of: -The stack -The heap -The garbage collector ?
Jul 16 2023
On Monday, 17 July 2023 at 03:43:04 UTC, Alain De Vos wrote:Is it possible to print runtime memory usage of: -The stack -The heap -The garbage collector ?there's gc.stats for part of it: https://dlang.org/library/core/memory/gc.stats.html
Jul 16 2023
``` import std.stdio:writeln; import core.memory; void main(){ ulong a=GC.Stats.freeSize; writeln(a); } ``` returns error: Error: need this for freeSize of type ulong
Jul 18 2023
On 7/18/23 5:04 PM, Alain De Vos wrote:?use `stats` instead of `Stats`. The `Stats` name is the type, whereas the `stats` method is the call that gets the stats. It's kind of a terrible message, I wish it would change to something more informative. -Steve
Jul 18 2023
On Wednesday, 19 July 2023 at 01:13:23 UTC, Steven Schveighoffer wrote:It's kind of a terrible message, I wish it would change to something more informative.As of https://github.com/dlang/dmd/pull/15430, there's a new message: ``` accessing non-static variable `freeSize` requires an instance of type `Stats` ```
Jul 20 2023
On Monday, 17 July 2023 at 03:43:04 UTC, Alain De Vos wrote:Is it possible to print runtime memory usage of: -The stack -The heap -The garbage collector ?And how to print the memory stats of each class / struct type? 
Apr 24