prolog and epilog code

Steven Schveighoffer via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Tue Aug 2 04:37:05 PDT 2016


On 8/1/16 9:24 PM, Rufus Smith wrote:
> 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?

Of course! You just have to modify druntime :)

One thing you can do instead is compile without a D main function, and 
use C main, initialize the runtime manually. Then you can put your 
measurement code around the runtime initialization and termination.

See here: http://dlang.org/phobos/core_runtime.html#.rt_init

-Steve


More information about the Digitalmars-d-learn mailing list