Skip to main content

fz_clone_context

Function fz_clone_context 

Source
pub unsafe extern "C" fn fz_clone_context(
    ctx: *mut fz_context,
) -> *mut fz_context
Expand description

Make a clone of an existing context.

This function is meant to be used in multi-threaded
applications where each thread requires its own context, yet
parts of the global state, for example caching, are shared.

ctx: Context obtained from [fz_new_context] to make a copy of.
ctx must have had locks and lock/functions setup when created.
The two contexts will share the memory allocator, resource
store, locks and lock/unlock functions. They will each have
their own exception stacks though.

May return NULL.