Use a hash map to keep a strong reference to the reified native function pointer to prevent its collection until the visitor has finished.