Hooking into GC

Ali Çehreli via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Tue Jun 28 22:10:23 PDT 2016


On 06/28/2016 08:39 PM, MMJones wrote:

 > 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?

No. Somebody must explicitly build the library.

However, any code that's templated cannot be pre-built because it must 
work with user-defined types, which the compiler cannot be aware of 
ahead of time.

 > 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.

It won't work with the non-templated parts of the library but go ahead 
and modify almost anything in std.algorithm and you will see the effect 
as soon as you compile your program. :)

Ali



More information about the Digitalmars-d-learn mailing list