Function zstd_sys::ZDICT_optimizeTrainFromBuffer_cover
source · pub unsafe extern "C" fn ZDICT_optimizeTrainFromBuffer_cover(
dictBuffer: *mut c_void,
dictBufferCapacity: usize,
samplesBuffer: *const c_void,
samplesSizes: *const usize,
nbSamples: c_uint,
parameters: *mut ZDICT_cover_params_t,
) -> usize
Expand description
ZDICT_optimizeTrainFromBuffer_cover():
The same requirements as above hold for all the parameters except parameters
.
This function tries many parameter combinations and picks the best parameters.
*parameters
is filled with the best parameters found,
dictionary constructed with those parameters is stored in dictBuffer
.
All of the parameters d, k, steps are optional. If d is non-zero then we don’t check multiple values of d, otherwise we check d = {6, 8}. if steps is zero it defaults to its default value. If k is non-zero then we don’t check multiple values of k, otherwise we check steps values in [50, 2000].
@return: size of dictionary stored into dictBuffer
(<= dictBufferCapacity
)
or an error code, which can be tested with ZDICT_isError().
On success *parameters
contains the parameters selected.
See ZDICT_trainFromBuffer() for details on failure modes.
Note: ZDICT_optimizeTrainFromBuffer_cover() requires about 8 bytes of memory for each input byte and additionally another 5 bytes of memory for each byte of memory for each thread.