Code generation for foreign pointer finalizers