|
|
data_ptr_t | dataptr = nullptr |
| |
|
idx_t | count = 0 |
| |
|
idx_t | capacity = 0 |
| |
◆ ArrowBuffer() [1/2]
| duckdb::ArrowBuffer::ArrowBuffer |
( |
| ) |
|
|
inline |
32649 : dataptr(nullptr), count(0), capacity(0) {
32650 }
◆ ~ArrowBuffer()
| duckdb::ArrowBuffer::~ArrowBuffer |
( |
| ) |
|
|
inline |
32651 {
32652 if (!dataptr) {
32653 return;
32654 }
32655 free(dataptr);
32656 dataptr = nullptr;
32657 count = 0;
32658 capacity = 0;
32659 }
◆ ArrowBuffer() [2/2]
| duckdb::ArrowBuffer::ArrowBuffer |
( |
ArrowBuffer && |
other | ) |
|
|
inlinenoexcept |
enable move constructors
32664 : count(0), capacity(0) {
32665 std::swap(dataptr, other.dataptr);
32666 std::swap(count, other.count);
32667 std::swap(capacity, other.capacity);
32668 }
◆ operator=()
32669 {
32670 std::swap(dataptr, other.dataptr);
32671 std::swap(count, other.count);
32672 std::swap(capacity, other.capacity);
32673 return *this;
32674 }
◆ reserve()
| void duckdb::ArrowBuffer::reserve |
( |
idx_t |
bytes | ) |
|
|
inline |
32676 {
32677 auto new_capacity = NextPowerOfTwo(bytes);
32678 if (new_capacity <= capacity) {
32679 return;
32680 }
32681 ReserveInternal(new_capacity);
32682 }
◆ resize() [1/2]
| void duckdb::ArrowBuffer::resize |
( |
idx_t |
bytes | ) |
|
|
inline |
32684 {
32685 reserve(bytes);
32686 count = bytes;
32687 }
◆ resize() [2/2]
32689 {
32690 reserve(bytes);
32691 for (idx_t i = count; i < bytes; i++) {
32692 dataptr[i] = value;
32693 }
32694 count = bytes;
32695 }
◆ push_back()
| void duckdb::ArrowBuffer::push_back |
( |
T |
value | ) |
|
|
inline |
32698 {
32699 reserve(sizeof(T) * (count + 1));
32700 reinterpret_cast<T *>(dataptr)[count] = value;
32701 count++;
32702 }
◆ size()
| idx_t duckdb::ArrowBuffer::size |
( |
| ) |
|
|
inline |
32704 {
32705 return count;
32706 }
◆ data()
| data_ptr_t duckdb::ArrowBuffer::data |
( |
| ) |
|
|
inline |
32708 {
32709 return dataptr;
32710 }
◆ GetData()
| T * duckdb::ArrowBuffer::GetData |
( |
| ) |
|
|
inline |
32713 {
32714 return reinterpret_cast<T *>(data());
32715 }
◆ ReserveInternal()
| void duckdb::ArrowBuffer::ReserveInternal |
( |
idx_t |
bytes | ) |
|
|
inlineprivate |
32718 {
32719 data_ptr_t new_ptr;
32720 if (dataptr) {
32721 new_ptr = data_ptr_cast(realloc(dataptr, bytes));
32722 } else {
32723 new_ptr = data_ptr_cast(malloc(bytes));
32724 }
32725 if (!new_ptr) {
32726 throw OutOfMemoryException("ArrowBuffer: failed to allocate %llu bytes", bytes);
32727 }
32728 dataptr = new_ptr;
32729 capacity = bytes;
32730 }
The documentation for this struct was generated from the following file:
- external/duckdb/duckdb.cpp