We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent cb6a848 commit f9f707cCopy full SHA for f9f707c
1 file changed
zstd.c
@@ -621,20 +621,10 @@ ZEND_FUNCTION(zstd_compress_init)
621
622
PHP_ZSTD_CONTEXT_OBJ_INIT_OF_CLASS(php_zstd_compress_context_ce);
623
624
- ctx->cctx = ZSTD_createCCtx();
625
- if (ctx->cctx == NULL) {
+ if (php_zstd_context_create_compress(ctx, level, NULL) != SUCCESS) {
626
zval_ptr_dtor(return_value);
627
- ZSTD_WARNING("failed to create compress context");
628
RETURN_FALSE;
629
}
630
- ctx->cdict = NULL;
631
-
632
- ZSTD_CCtx_reset(ctx->cctx, ZSTD_reset_session_only);
633
- ZSTD_CCtx_setParameter(ctx->cctx, ZSTD_c_compressionLevel, level);
634
635
- ctx->output.size = ZSTD_CStreamOutSize();
636
- ctx->output.dst = emalloc(ctx->output.size);
637
- ctx->output.pos = 0;
638
639
640
ZEND_FUNCTION(zstd_compress_add)
0 commit comments