On 1/17/22 8:23 PM, H. S. Teoh wrote:
>I'll take a look at the code now to see if there's anything easily
salvageable... but at this point I'm ready to propose pulling the
trigger on -profile=gc completely. (Based on how I suspect it works,
I'm expecting that it would not be easy to implement any useful output
for allocations via druntime functions -- at best you'd just get some
obscure file/line number inside druntime code which would be of no help
locating where in your code the allocation happened.)
Something like that might still be of help. At least it wouldn't lie and say no allocations happened.
But can't we just tag with a UDA a GC allocating function, and then the highest-level tag is registered with the profiler? Like:
@gcprofile void bar()
{
auto x = new int; // not flagged as allocating.
}
@gcprofile void foo()
{
bar(); // not flagged as allocating.
}
void main()
{
foo(); // flagged as allocating.
bar(); // flagged as allocating.
}
-Steve