HuaHuaY commented on code in PR #48865:
URL: https://github.com/apache/arrow/pull/48865#discussion_r2705024963
##########
cpp/src/arrow/util/compression_zstd.cc:
##########
@@ -235,13 +226,47 @@ class ZSTDCodec : public Codec {
int compression_level() const override { return compression_level_; }
private:
+ Result<CCtxPtr> CreateCCtx() const {
+ CCtxPtr cctx{ZSTD_createCCtx(), ZSTD_freeCCtx};
Review Comment:
I didn't see any relevant information in the Zstd documentation. But I found
that google uses `ZSTD_createCCtx()` and checks whether the return value is
`nullptr`. So I added a judgment that returns an error if the result is
`nullptr`.
##########
cpp/src/arrow/util/compression_zstd.cc:
##########
@@ -235,13 +226,47 @@ class ZSTDCodec : public Codec {
int compression_level() const override { return compression_level_; }
private:
+ Result<CCtxPtr> CreateCCtx() const {
+ CCtxPtr cctx{ZSTD_createCCtx(), ZSTD_freeCCtx};
Review Comment:
I didn't see any relevant information in the Zstd documentation. But I found
that google uses `ZSTD_createCCtx()` and checks whether the return value is
`nullptr`. So I added a judgment that returns an error if the result is
`nullptr`.
https://android.googlesource.com/platform/external/zstd/+/refs/heads/android14-mainline-adbd-release/examples/streaming_compression_thread_pool.c
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]