You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by "jacktengg (via GitHub)" <gi...@apache.org> on 2023/02/13 16:21:18 UTC
[GitHub] [doris] jacktengg opened a new pull request, #16680: [improvement](rowset reader) fix possible memleak
jacktengg opened a new pull request, #16680:
URL: https://github.com/apache/doris/pull/16680
# Proposed changes
Issue Number: close #xxx
## Problem summary
Fix possible memory leaks when constructing betarowset reader, by using unique_ptrs.
## Checklist(Required)
* [ ] Does it affect the original behavior
* [ ] Has unit tests been added
* [ ] Has document been added or modified
* [ ] Does it need to update dependencies
* [ ] Is this PR support rollback (If NO, please explain WHY)
## Further comments
If this is a relatively large or complex change, kick off the discussion at [dev@doris.apache.org](mailto:dev@doris.apache.org) by explaining why you chose the solution you did and what alternatives you considered, etc...
--
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
[GitHub] [doris] yiguolei merged pull request #16680: [improvement](rowset reader) fix possible memleak
Posted by "yiguolei (via GitHub)" <gi...@apache.org>.
yiguolei merged PR #16680:
URL: https://github.com/apache/doris/pull/16680
--
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
[GitHub] [doris] github-actions[bot] commented on a diff in pull request #16680: [improvement](rowset reader) fix possible memleak
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on code in PR #16680:
URL: https://github.com/apache/doris/pull/16680#discussion_r1104724983
##########
be/src/vec/olap/vgeneric_iterators.h:
##########
@@ -80,10 +80,7 @@ class VMergeIteratorContext {
VMergeIteratorContext& operator=(const VMergeIteratorContext&) = delete;
VMergeIteratorContext& operator=(VMergeIteratorContext&&) = delete;
- ~VMergeIteratorContext() {
- delete _iter;
- _iter = nullptr;
- }
+ ~VMergeIteratorContext() {}
Review Comment:
warning: use '= default' to define a trivial destructor [modernize-use-equals-default]
```suggestion
~VMergeIteratorContext() = default;
```
##########
be/src/vec/olap/vertical_merge_iterator.h:
##########
@@ -143,10 +143,7 @@ class VerticalMergeIteratorContext {
VerticalMergeIteratorContext& operator=(const VerticalMergeIteratorContext&) = delete;
VerticalMergeIteratorContext& operator=(VerticalMergeIteratorContext&&) = delete;
- ~VerticalMergeIteratorContext() {
- delete _iter;
- _iter = nullptr;
- }
+ ~VerticalMergeIteratorContext() {}
Review Comment:
warning: use '= default' to define a trivial destructor [modernize-use-equals-default]
```suggestion
~VerticalMergeIteratorContext() = default;
```
##########
be/src/vec/olap/vgeneric_iterators.cpp:
##########
@@ -343,12 +344,9 @@ class VUnionIterator : public RowwiseIterator {
// Iterators' ownership it transferred to this class.
// This class will delete all iterators when destructs
// Client should not use iterators anymore.
- VUnionIterator(std::vector<RowwiseIterator*>& v) : _origin_iters(v.begin(), v.end()) {}
+ VUnionIterator(std::vector<RowwiseIteratorUPtr>&& v) : _origin_iters(std::move(v)) {}
- ~VUnionIterator() override {
- std::for_each(_origin_iters.begin(), _origin_iters.end(),
- std::default_delete<RowwiseIterator>());
- }
+ ~VUnionIterator() override {}
Review Comment:
warning: use '= default' to define a trivial destructor [modernize-use-equals-default]
```suggestion
~VUnionIterator() override = default;
```
--
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