plugins/ocaml/ocaml.c
/* We always have an unload function, since it also has to free the
 * globals we allocated.
 */
We always have an unload function, since it also has to free the
globals we allocated.
We always have an unload function since it also has to free the globals we allocated .
static void
unload_wrapper (void)
{
  if (unload_fn) {
    caml_leave_blocking_section ();
    caml_callback (unload_fn, Val_unit);
    caml_enter_blocking_section ();
  }
  free ((char *) plugin.name);
  free ((char *) plugin.longname);
  free ((char *) plugin.version);
  free ((char *) plugin.description);
  free ((char *) plugin.config_help);
#define REMOVE(fn) \
  if (fn##_fn) caml_remove_generational_global_root (&fn##_fn)
  REMOVE (load);
  REMOVE (unload);
  REMOVE (config);
  REMOVE (config_complete);
  REMOVE (open);
  REMOVE (close);
  REMOVE (get_size);
  REMOVE (can_write);
  REMOVE (can_flush);
  REMOVE (is_rotational);
  REMOVE (can_trim);
  REMOVE (dump_plugin);
  REMOVE (can_zero);
  REMOVE (can_fua);
  REMOVE (pread);
  REMOVE (pwrite);
  REMOVE (flush);
  REMOVE (trim);
  REMOVE (zero);
  REMOVE (can_multi_conn);
}
static void unload_wrapper ( void ) { if ( unload_fn ) { caml_leave_blocking_section ( ) ; caml_callback ( unload_fn , Val_unit ) ; caml_enter_blocking_section ( ) ; } free ( ( char * ) plugin . name ) ; free ( ( char * ) plugin . longname ) ; free ( ( char * ) plugin . version ) ; free ( ( char * ) plugin . description ) ; free ( ( char * ) plugin . config_help ) ; #define REMOVE ( fn )  \
  if (fn##_fn) caml_remove_generational_global_root (&fn##_fn) REMOVE ( load ) ; REMOVE ( unload ) ; REMOVE ( config ) ; REMOVE ( config_complete ) ; REMOVE ( open ) ; REMOVE ( close ) ; REMOVE ( get_size ) ; REMOVE ( can_write ) ; REMOVE ( can_flush ) ; REMOVE ( is_rotational ) ; REMOVE ( can_trim ) ; REMOVE ( dump_plugin ) ; REMOVE ( can_zero ) ; REMOVE ( can_fua ) ; REMOVE ( pread ) ; REMOVE ( pwrite ) ; REMOVE ( flush ) ; REMOVE ( trim ) ; REMOVE ( zero ) ; REMOVE ( can_multi_conn ) ; }
We always have an unload function, since it also has to free the
 globals we allocated.
We always have an unload function since it also has to free the globals we allocated .