prolog and epilog code

Rufus Smith via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Mon Aug 1 18:24:41 PDT 2016


Can one add code that executes before the GC and any memory is 
normally allocated(even static) and after all of it was suppose 
to be released?

A sort of static this for the whole app. I would like to monitor 
the memory of the app to make sure that the total memory before 
and after is equal. I use my own memory routines but would like 
something where I can write out the information after all 
destructors have been called.

I have malloc and free wrapped and simply add the total memory 
used and released. These, of course, should be the same *after* 
program termination. But, I can't wait that long ;)




More information about the Digitalmars-d-learn mailing list