/*
* call-seq:
* proc.unbind => UnboundProc
*
* Create an UnboundProc from a Proc.
*/
static VALUE proc_unbind(VALUE self)
{
#ifdef RUBY_HAS_YARV
rb_proc_t * p;
GetProcPtr(self, p);
return create_proc(rb_cUnboundProc, Qnil, p->block.iseq);
#else
struct BLOCK * b;
Data_Get_Struct(self, struct BLOCK, b);
/* no need for a security check to unbind a proc -- though without the
* ability to bind, this doesn't seem very useful.
*/
return create_proc(rb_cUnboundProc, Qnil, b->body, b->var);
#endif
}