pub unsafe extern "C" fn WasmEdge_ModuleInstanceCreateWithData(
    ModuleName: WasmEdge_String,
    HostData: *mut c_void,
    Finalizer: Option<unsafe extern "C" fn(arg1: *mut c_void)>
) -> *mut WasmEdge_ModuleInstanceContext
Expand description

Creation of the WasmEdge_ModuleInstanceContext with host data.

Create a module instance context with exported module name, host data, and host data finalizer for host instances. Developer can use this API to create a module instance for collecting host functions, tables, memories, and globals. When this created module instance being destroyed, the host data finalizer will be invoked. The caller owns the object and should call WasmEdge_ModuleInstanceDelete to destroy it.

\param ModuleName the module name WasmEdge_String of this host module to import. \param HostData the host data to set into the module instance. When calling the finalizer, this pointer will become the argument of the finalizer function. \param Finalizer the function to finalize the host data.

\returns pointer to context, NULL if failed.