Thread overview
Print debug data
Jul 18
Kagamin
Jul 20
Dennis
Apr 24
mw
July 17

Is it possible to print runtime memory usage of:
-The stack
-The heap
-The garbage collector ?

July 17

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

July 18

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

July 18

Naming is hard.

July 18

?

July 18

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

July 20

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`
April 24

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?