Skip to main content

fizzy_clone_module

Function fizzy_clone_module 

Source
pub unsafe extern "C" fn fizzy_clone_module(
    module: *const FizzyModule,
) -> *const FizzyModule
Expand description

Make a copy of a module.

@param module Pointer to module. Cannot be NULL. @return Pointer to a newly allocated module, identical to @p module, or NULL in case memory for a module could not be allocated.

@note Creating a copy is needed if more than single instance of a module is required, because instantiation takes ownership of a module, and the same module cannot be instantiated twice. @note Input module is not modified neither in success nor in failure case.