Ruby 3.4 リファレンスマニュアル

function rb_set_end_proc

[edit]
void rb_set_end_proc(void (*func)(VALUE), VALUE data)