Hooking into GC

MMJones via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Tue Jun 28 20:39:26 PDT 2016


On Wednesday, 29 June 2016 at 03:10:10 UTC, thedeemon wrote:
> On Wednesday, 29 June 2016 at 02:18:27 UTC, MMJones wrote:
>> I read somewhere that one can modify the D files from phobos 
>> and runtime to supply a stub for the GC. I would like to add 
>> some logging features to the GC.
>
>
> You don't need to recompile anything, a stub can be installed 
> from your program. See an example (which can do logging) here:
> https://bitbucket.org/infognition/dstuff/src/97cef6d4a0438f9a9f4ff0d18f819262b8a74888/trackallocs.d?fileviewer=file-view-default

Yeah, I saw that. I'm looking the general answer though. Not just 
for GC. Does D basically combine the d files in to phobos when 
they are modified?

What if I want to log all file operations? It would be easier to 
stick a log function in std.file but I have a feeling it won't be 
recompiled and used.




More information about the Digitalmars-d-learn mailing list