Enabling the target-independent garbage collection infrastructure by hooking it