xinyiZzz commented on code in PR #19472:
URL: https://github.com/apache/doris/pull/19472#discussion_r1193188350


##########
be/src/olap/rowset/segment_v2/page_handle.h:
##########
@@ -46,42 +46,49 @@ class PageHandle {
             : _is_data_owner(false), _cache_data(std::move(cache_data)) {}
 
     // Move constructor
-    PageHandle(PageHandle&& other) noexcept
-            : _is_data_owner(false),
-              _data(std::move(other._data)),
-              _cache_data(std::move(other._cache_data)) {
+    PageHandle(PageHandle&& other) noexcept : 
_cache_data(std::move(other._cache_data)) {
         // we can use std::exchange if we switch c++14 on
         std::swap(_is_data_owner, other._is_data_owner);
+        _data.swap(other._data);
     }
 
     PageHandle& operator=(PageHandle&& other) noexcept {
         std::swap(_is_data_owner, other._is_data_owner);
-        _data = std::move(other._data);
+        _data.swap(other._data);
         _cache_data = std::move(other._cache_data);
         return *this;
     }
 
     ~PageHandle() {
         if (_is_data_owner && _data.size > 0) {
-            delete[] _data.data;
             
ExecEnv::GetInstance()->page_no_cache_mem_tracker()->consume(-_data.size);
+        } else {
+            DCHECK(_data.size == 0);
         }
     }
 
     // the return slice contains uncompressed page body, page footer, and 
footer size
-    Slice data() const {
+    char* data() const {

Review Comment:
   It seems more graceful that DataPage and Slick are independent?
   
   
![image](https://github.com/apache/doris/assets/13197424/bb006bb8-6e1a-4a4e-840a-ef4921077919)



-- 
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: commits-unsubscr...@doris.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


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

Reply via email to