|
|
StringHeap | heap |
| | The string heap of this buffer.
|
|
vector< buffer_ptr< VectorBuffer > > | references |
| | References to additional vector buffers referenced by this string buffer.
|
◆ VectorStringBuffer() [1/3]
| duckdb::VectorStringBuffer::VectorStringBuffer |
( |
| ) |
|
138723 : VectorBuffer(VectorBufferType::STRING_BUFFER) {
138724}
◆ VectorStringBuffer() [2/3]
| duckdb::VectorStringBuffer::VectorStringBuffer |
( |
Allocator & | allocator | ) |
|
|
explicit |
138727 : VectorBuffer(VectorBufferType::STRING_BUFFER),
heap(allocator) {
138728}
StringHeap heap
The string heap of this buffer.
Definition duckdb.hpp:10172
◆ VectorStringBuffer() [3/3]
| duckdb::VectorStringBuffer::VectorStringBuffer |
( |
VectorBufferType | type | ) |
|
|
explicit |
138730 : VectorBuffer(type) {
138731}
◆ AddString() [1/2]
| string_t duckdb::VectorStringBuffer::AddString |
( |
const char * | data, |
|
|
idx_t | len ) |
|
inline |
10131 {
10132 return heap.AddString(data, len);
10133 }
◆ AddString() [2/2]
10134 {
10135 return heap.AddString(data);
10136 }
◆ AddBlob()
10137 {
10138 return heap.AddBlob(data.GetData(), data.GetSize());
10139 }
◆ EmptyString()
10140 {
10141 return heap.EmptyString(len);
10142 }
◆ GetStringAllocator()
10144 {
10145 return heap.GetAllocator();
10146 }
◆ AllocateShrinkableBuffer()
| data_ptr_t duckdb::VectorStringBuffer::AllocateShrinkableBuffer |
( |
idx_t | alloc_len | ) |
|
|
inline |
Allocate a buffer to store up to "len" bytes for a string This can be turned into a proper string by using FinalizeBuffer afterwards Note that alloc_len only has to be an upper bound, the final string may be smaller
10150 {
10151 auto &allocator =
heap.GetAllocator();
10152 return allocator.Allocate(alloc_len);
10153 }
◆ FinalizeShrinkableBuffer()
| string_t duckdb::VectorStringBuffer::FinalizeShrinkableBuffer |
( |
data_ptr_t | buffer, |
|
|
idx_t | alloc_len, |
|
|
idx_t | str_len ) |
|
inline |
Finalize a buffer allocated with AllocateShrinkableBuffer into a string of size str_len str_len must be <= alloc_len
10156 {
10157 auto &allocator =
heap.GetAllocator();
10158 D_ASSERT(str_len <= alloc_len);
10159 D_ASSERT(buffer == allocator.GetHead()->data.get() + allocator.GetHead()->current_position - alloc_len);
10160 bool is_not_inlined = str_len > string_t::INLINE_LENGTH;
10161 idx_t shrink_count = alloc_len - (str_len * is_not_inlined);
10162 allocator.ShrinkHead(shrink_count);
10163 return string_t(const_char_ptr_cast(buffer), UnsafeNumericCast<uint32_t>(str_len));
10164 }
uint64_t idx_t
a saner size_t for loop indices etc
Definition duckdb.hpp:237
◆ AddHeapReference()
| void duckdb::VectorStringBuffer::AddHeapReference |
( |
buffer_ptr< VectorBuffer > | heap | ) |
|
|
inline |
10166 {
10168 }
vector< buffer_ptr< VectorBuffer > > references
References to additional vector buffers referenced by this string buffer.
Definition duckdb.hpp:10174
The documentation for this class was generated from the following files: