Hunting down rogue memory allocations?
thedeemon via Digitalmars-d-learn
digitalmars-d-learn at puremagic.com
Fri Oct 3 01:18:43 PDT 2014
On Thursday, 2 October 2014 at 20:16:56 UTC, Gary Willoughby
wrote:
> Say i have created a program written in D, what tools are
> available for me to track memory allocations?
I wrote a tiny module trackallocs.d that inserts a GC proxy and
outputs to log file (or stdout) all the allocations, gathering
some stats.
You can turn tracking on and off in any place of your code.
Used it before 2.066 where @nogc appeared to check whether my
code was allocation-free. Current version works in both 2.066 and
earlier versions. Find it here:
https://bitbucket.org/infognition/dstuff/src/
Inside it uses one hack based on knowledge of D runtime
internals, so in future versions of D runtime, if Proxy struct
changes again, it may need to be changed as well.
More information about the Digitalmars-d-learn
mailing list