On Mon, 03 Jan 2011 05:34:55 +0200, %u <[email protected]> wrote:
Is there any way to add a hook to the garbage collector in D, so that I
can be
immediately notified (for example) when an object is created?
FWIW, Diamond ( http://github.com/CyberShadow/Diamond ) hooks various GC
functions, but it's an ugly hack that breaks with multi-threaded programs
(and the module is D1 and x86-only). A better run-time solution (not
involving modifying Phobos/druntime) would need a instruction-length
disassembler.
--
Best regards,
Vladimir mailto:[email protected]