Tracing allocations with "new" in dmd

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Fri Jun 19 15:36:08 UTC 2020


On 6/19/20 10:34 AM, Guillaume Piolat wrote:
> On Friday, 19 June 2020 at 14:19:36 UTC, Andrei Alexandrescu wrote:
>>>
>>> -profile=gc ?
>>
>> Thanks, I'll look into it. Does it provide type information or only 
>> low-level allocated size information?
> 
> Here is an example of a profilegc.log file:
> 
> --------------- profilegc.log -----------
> 
> 
> bytes allocated, allocations, type, function, file:line
>             4096                  1    char[] D main source\main.d:36
>              240                 10    main.main.D D main source\main.d:44
>               64                  1    int[] D main source\main.d:37
>               56                  1    double[] D main source\main.d:55
> 
> 
> -----------------------------------------

Thanks. A quick experiment (built dmd itself with -profile=gc, ran it on 
a few simple files) seems to show that only array allocations are 
traced, but not allocations of individual objects.


More information about the Digitalmars-d mailing list