github-actions[bot] commented on code in PR #39031:
URL: https://github.com/apache/doris/pull/39031#discussion_r1709419346
##########
be/src/pipeline/local_exchange/local_exchanger.h:
##########
@@ -135,13 +158,25 @@ class Exchanger : public ExchangerBase {
class LocalExchangeSourceLocalState;
class LocalExchangeSinkLocalState;
-struct ShuffleBlockWrapper {
- ENABLE_FACTORY_CREATOR(ShuffleBlockWrapper);
- ShuffleBlockWrapper(vectorized::Block&& data_block_) :
data_block(std::move(data_block_)) {}
+/**
+ * `BlockWrapper` is used to wrap a data block with a reference count.
+ *
+ * In function `unref()`, if `ref_count` decremented to 0, which means this
block is not needed by
+ * operators, so we put it into `_free_blocks` to reuse its memory if needed
and refresh memory usage
+ * in current queue.
+ *
+ * Note: `ref_count` will be larger than 1 only if this block is shared
between multiple queues in
+ * shuffle exchanger.
+ */
+struct BlockWrapper {
+ ENABLE_FACTORY_CREATOR(BlockWrapper);
+ BlockWrapper(vectorized::Block&& data_block_) :
data_block(std::move(data_block_)) {}
+ ~BlockWrapper() { DCHECK_EQ(ref_count.load(), 0); }
Review Comment:
warning: use '= default' to define a trivial destructor
[modernize-use-equals-default]
```cpp
~BlockWrapper() { DCHECK_EQ(ref_count.load(), 0); }
^
```
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]