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



2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
# File 'ext/multi_compress/multi_compress.c', line 2631

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);
    VALUE size_val = NIL_P(opts) ? Qnil : rb_hash_aref(opts, ID2SYM(rb_intern("size")));
    return train_dictionary_internal(samples, size_val, ALGO_ZSTD);
}