[][src]Function artichoke_backend::def::box_unbox_free

pub unsafe extern "C" fn box_unbox_free<T>(
    _mrb: *mut mrb_state,
    data: *mut c_void
) where
    T: 'static + BoxUnboxVmValue

A generic implementation of a Free function for mrb_values that store an owned copy of a Box smart pointer.

This function ultimately calls Box::from_raw on the data pointer and drops the resulting Box.


This function assumes that the data pointer is to an Box<T> created by Box::into_raw. This fuction bounds T by BoxUnboxVmValue which boxes T for the mruby VM like this.

This function assumes it is called by the mruby VM as a free function for an MRB_TT_DATA.