Module: MultiCompress::Zstd

Defined in:
ext/multi_compress/multi_compress.c

Constant Summary collapse

MIN_LEVEL =
INT2FIX(1)
MAX_LEVEL =
INT2FIX(22)
DEFAULT_LEVEL =
INT2FIX(3)

Class Method Summary collapse

Class Method Details

.train_dictionary(*args) ⇒ Object



2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
# File 'ext/multi_compress/multi_compress.c', line 2740

static VALUE zstd_train_dictionary(int argc, VALUE *argv, VALUE self) {
    // #if defined(__APPLE__) && (defined(__arm64__) || defined(__aarch64__))
    //     rb_raise(eUnsupportedError,
    //              "Zstd dictionary training is temporarily disabled on arm64-darwin "
    //              "because the current vendored trainer path crashes on this platform");
    // #endif

    VALUE samples, opts;
    rb_scan_args(argc, argv, "1:", &samples, &opts);
    reject_algorithm_keyword(opts);
    VALUE size_val = opt_get(opts, sym_cache.size);
    return train_dictionary_internal(samples, size_val, ALGO_ZSTD);
}