[GLUTEN-10833][VL] Reduce memcpy in ColumnToRow#10824
Merged
zhouyuan merged 2 commits intoapache:mainfrom Oct 16, 2025
Merged
Conversation
| veloxBuffers_ = velox::AlignedBuffer::allocate<uint8_t>(totalMemorySize, veloxPool_.get()); | ||
| } else if (veloxBuffers_->capacity() < totalMemorySize) { | ||
| velox::AlignedBuffer::reallocate<uint8_t>(&veloxBuffers_, totalMemorySize); | ||
| veloxBuffers_.reset(); |
Member
Author
There was a problem hiding this comment.
this will ensure the buffer allocated previously released
Contributor
There was a problem hiding this comment.
@zhouyuan The resource will be automatically released when the smart pointer is assigned a new value, as the assignment operator handles the reference counting internally. We can simplify the code to:
if (veloxBuffers_ == nullptr || veloxBuffers_->capacity() < totalMemorySize) {
veloxBuffers_ = velox::AlignedBuffer::allocate<uint8_t>(totalMemorySize, veloxPool_.get());
}
1f62c20 to
644ee51
Compare
We always fill the buffer with 0 so it's no necessary to keep the old content when doing allocation in C2R Signed-off-by: Yuan <yuanzhou@apache.org>
644ee51 to
21a9960
Compare
|
Run Gluten Clickhouse CI on x86 |
JkSelf
approved these changes
Oct 14, 2025
Contributor
JkSelf
left a comment
There was a problem hiding this comment.
LGTM. Thanks for your improvement.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changes are proposed in this pull request?
We always fill the buffer with
0so it's no necessary to keep the old content when doing allocation in C2RFixes #10833
How was this patch tested?
pass GHA