You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by GitBox <gi...@apache.org> on 2022/01/07 10:50:53 UTC

[GitHub] [incubator-doris] HappenLee commented on a change in pull request #7558: [refactor](olap) prefer to malloc for _variable_buf once rather than malloc repeatedly

HappenLee commented on a change in pull request #7558:
URL: https://github.com/apache/incubator-doris/pull/7558#discussion_r780188135



##########
File path: be/src/olap/row_cursor.cpp
##########
@@ -28,19 +28,6 @@ using std::string;
 using std::vector;
 
 namespace doris {
-RowCursor::RowCursor()
-        : _fixed_len(0), _variable_len(0), _string_field_count(0), _long_text_buf(nullptr) {}
-
-RowCursor::~RowCursor() {
-    delete[] _owned_fixed_buf;
-    delete[] _variable_buf;
-    if (_string_field_count > 0 && _long_text_buf != nullptr) {
-        for (int i = 0; i < _string_field_count; ++i) {
-            free(_long_text_buf[i]);

Review comment:
       the long_text_buf should release one by one. because string type will realloc the mem 




-- 
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-unsubscribe@doris.apache.org

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



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