Skip to content
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

Minor: Clarify NullBufferBuilder::new capacity parameter #7016

Merged
merged 2 commits into from
Jan 25, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion arrow-buffer/src/builder/boolean.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,11 @@ pub struct BooleanBufferBuilder {
}

impl BooleanBufferBuilder {
/// Creates a new `BooleanBufferBuilder`
/// Creates a new `BooleanBufferBuilder` with sufficient space for
/// `capacity` bits (not bytes).
///
/// The capacity is rounded up to the nearest multiple of 8 for the
/// allocation.
#[inline]
pub fn new(capacity: usize) -> Self {
let byte_capacity = bit_util::ceil(capacity, 8);
Expand Down
5 changes: 4 additions & 1 deletion arrow-buffer/src/builder/null.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,10 @@ pub struct NullBufferBuilder {

impl NullBufferBuilder {
/// Creates a new empty builder.
/// `capacity` is the number of bits in the null buffer.
///
/// Note that this method does not allocate any memory, regardless of the
/// `capacity` parameter. If an allocation is required, `capacity` is the
/// size in bits (not bytes) that will be allocated at minimum.
pub fn new(capacity: usize) -> Self {
Self {
bitmap_builder: None,
Expand Down
Loading