Skip to content

Commit

Permalink
Resize in lieu of just reserving (#574)
Browse files Browse the repository at this point in the history
* Resize in lieu of just reserving

* Update NEWS and roll micro version [ci skip]
  • Loading branch information
eddelbuettel authored Jul 18, 2023
1 parent cf0b0ee commit 39c7d83
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: tiledb
Type: Package
Version: 0.20.1
Version: 0.20.1.1
Title: Universal Storage Engine for Sparse and Dense Multidimensional Arrays
Authors@R: c(person("TileDB, Inc.", role = c("aut", "cph")),
person("Dirk", "Eddelbuettel", email = "dirk@tiledb.com", role = "cre"))
Expand Down
7 changes: 7 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
# tiledb - ongoing development

## Improvements

* The column buffer allocation is now robust to container overflow sanitizer checks (#574)


# tilebd 0.20.1

* This release of the R package builds against [TileDB 2.16.0](https://github.com/TileDB-Inc/TileDB/releases/tag/2.16.0), and has also been tested against earlier releases as well as the development version
Expand Down
6 changes: 3 additions & 3 deletions src/column_buffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -139,12 +139,12 @@ ColumnBuffer::ColumnBuffer(
// Call reserve() to allocate memory without initializing the contents.
// This reduce the time to allocate the buffer and reduces the
// resident memory footprint of the buffer.
data_.reserve(num_bytes);
data_.resize(num_bytes);
if (is_var_) {
offsets_.reserve(num_cells + 1); // extra offset for arrow
offsets_.resize(num_cells + 1); // extra offset for arrow
}
if (is_nullable_) {
validity_.reserve(num_cells);
validity_.resize(num_cells);
}
}

Expand Down

0 comments on commit 39c7d83

Please sign in to comment.