Function zstd_sys::ZSTD_initStaticCCtx [] [src]

pub unsafe extern "C" fn ZSTD_initStaticCCtx(
    workspace: *mut c_void,
    workspaceSize: usize
) -> *mut ZSTD_CCtx

ZSTD_initStaticCCtx() : initialize a fixed-size zstd compression context workspace: The memory area to emplace the context into. Provided pointer must 8-bytes aligned. It must outlive context usage. workspaceSize: Use ZSTD_estimateCCtxSize() or ZSTD_estimateCStreamSize() to determine how large workspace must be to support scenario. @return : pointer to ZSTD_CCtx*, or NULL if error (size too small) Note : zstd will never resize nor malloc() when using a static cctx. If it needs more memory than available, it will simply error out. Note 2 : there is no corresponding "free" function. Since workspace was allocated externally, it must be freed externally too. Limitation 1 : currently not compatible with internal CDict creation, such as ZSTD_CCtx_loadDictionary() or ZSTD_initCStream_usingDict(). Limitation 2 : currently not compatible with multi-threading