-
Notifications
You must be signed in to change notification settings - Fork 3.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GH-40431: [C++] Move key_hash/key_map/light_array related files to internal for prevent using by users #40484
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -89,7 +89,7 @@ class ARROW_EXPORT TempVectorStack { | |
Status Init(MemoryPool* pool, int64_t size) { | ||
num_vectors_ = 0; | ||
top_ = 0; | ||
buffer_size_ = PaddedAllocationSize(size) + kPadding + 2 * sizeof(uint64_t); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We have already added the kPadding in PaddedAllocationSize, it's unnecessary to add it again. |
||
buffer_size_ = EstimatedAllocationSize(size); | ||
ARROW_ASSIGN_OR_RAISE(auto buffer, AllocateResizableBuffer(size, pool)); | ||
// Ensure later operations don't accidentally read uninitialized memory. | ||
std::memset(buffer->mutable_data(), 0xFF, size); | ||
|
@@ -98,7 +98,11 @@ class ARROW_EXPORT TempVectorStack { | |
} | ||
|
||
private: | ||
int64_t PaddedAllocationSize(int64_t num_bytes) { | ||
static int64_t EstimatedAllocationSize(int64_t size) { | ||
return PaddedAllocationSize(size) + 2 * sizeof(uint64_t); | ||
} | ||
|
||
static int64_t PaddedAllocationSize(int64_t num_bytes) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe we can align all the function names to either |
||
// Round up allocation size to multiple of 8 bytes | ||
// to avoid returning temp vectors with unaligned address. | ||
// | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you move this comment to
CheckAllocSizeValid()
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done