ext/zstdruby/common.h in zstd-ruby-1.5.6.3 vs ext/zstdruby/common.h in zstd-ruby-1.5.6.4
- old
+ new
@@ -42,32 +42,32 @@
rb_raise(rb_eRuntimeError, "%s", "ZSTD_CCtx_loadDictionary failed");
}
}
}
-struct compress_params {
+struct stream_compress_params {
ZSTD_CCtx* ctx;
ZSTD_outBuffer* output;
ZSTD_inBuffer* input;
ZSTD_EndDirective endOp;
size_t ret;
};
-static void* compress_wrapper(void* args)
+static void* stream_compress_wrapper(void* args)
{
- struct compress_params* params = args;
+ struct stream_compress_params* params = args;
params->ret = ZSTD_compressStream2(params->ctx, params->output, params->input, params->endOp);
return NULL;
}
-static size_t zstd_compress(ZSTD_CCtx* const ctx, ZSTD_outBuffer* output, ZSTD_inBuffer* input, ZSTD_EndDirective endOp, bool gvl)
+static size_t zstd_stream_compress(ZSTD_CCtx* const ctx, ZSTD_outBuffer* output, ZSTD_inBuffer* input, ZSTD_EndDirective endOp, bool gvl)
{
#ifdef HAVE_RUBY_THREAD_H
if (gvl) {
return ZSTD_compressStream2(ctx, output, input, endOp);
} else {
- struct compress_params params = { ctx, output, input, endOp };
- rb_thread_call_without_gvl(compress_wrapper, ¶ms, NULL, NULL);
+ struct stream_compress_params params = { ctx, output, input, endOp };
+ rb_thread_call_without_gvl(stream_compress_wrapper, ¶ms, NULL, NULL);
return params.ret;
}
#else
return ZSTD_compressStream2(ctx, output, input, endOp);
#endif