This is an automated email from the ASF dual-hosted git repository.

yiguolei pushed a commit to branch branch-2.1
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/branch-2.1 by this push:
     new 5bcdc752837 fix compile
5bcdc752837 is described below

commit 5bcdc752837e97ef4a245a1ccf42f105d096720e
Author: yiguolei <yiguo...@gmail.com>
AuthorDate: Sat May 25 09:00:48 2024 +0800

    fix compile
---
 be/src/util/block_compression.cpp | 20 ++++++++++++--------
 1 file changed, 12 insertions(+), 8 deletions(-)

diff --git a/be/src/util/block_compression.cpp 
b/be/src/util/block_compression.cpp
index 3dd0d92c944..5f4886ab49b 100644
--- a/be/src/util/block_compression.cpp
+++ b/be/src/util/block_compression.cpp
@@ -95,13 +95,14 @@ private:
         ENABLE_FACTORY_CREATOR(Context);
 
     public:
-        Context() : ctx(nullptr) {}
+        Context() : ctx(nullptr) { buffer = std::make_unique<faststring>(); }
         LZ4_stream_t* ctx;
-        faststring buffer;
+        std::unique_ptr<faststring> buffer;
         ~Context() {
             if (ctx) {
                 LZ4_freeStream(ctx);
             }
+            buffer.reset();
         }
     };
 
@@ -242,13 +243,14 @@ private:
         ENABLE_FACTORY_CREATOR(CContext);
 
     public:
-        CContext() : ctx(nullptr) {}
+        CContext() : ctx(nullptr) { buffer = std::make_unique<faststring>(); }
         LZ4F_compressionContext_t ctx;
-        faststring buffer;
+        std::unique_ptr<faststring> buffer;
         ~CContext() {
             if (ctx) {
                 LZ4F_freeCompressionContext(ctx);
             }
+            buffer.reset();
         }
     };
     class DContext {
@@ -470,13 +472,14 @@ private:
         ENABLE_FACTORY_CREATOR(Context);
 
     public:
-        Context() : ctx(nullptr) {}
+        Context() : ctx(nullptr) { buffer = std::make_unique<faststring>(); }
         LZ4_streamHC_t* ctx;
-        faststring buffer;
+        std::unique_ptr<faststring> buffer;
         ~Context() {
             if (ctx) {
                 LZ4_freeStreamHC(ctx);
             }
+            buffer.reset();
         }
     };
 
@@ -768,13 +771,14 @@ private:
         ENABLE_FACTORY_CREATOR(CContext);
 
     public:
-        CContext() : ctx(nullptr) {}
+        CContext() : ctx(nullptr) { buffer = std::make_unique<faststring>(); }
         ZSTD_CCtx* ctx;
-        faststring buffer;
+        std::unique_ptr<faststring> buffer;
         ~CContext() {
             if (ctx) {
                 ZSTD_freeCCtx(ctx);
             }
+            buffer.reset();
         }
     };
     class DContext {


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to