◆ AddString() [1/2]
10131 {
10133 }
DUCKDB_API string_t AddString(const char *data, idx_t len)
Add a string to the string heap, returns a pointer to the string.
StringHeap heap
The string heap of this buffer.
Definition duckdb.hpp:10172
◆ AddString() [2/2]
◆ AddBlob()
10137 {
10138 return heap.
AddBlob(data.GetData(), data.GetSize());
10139 }
DUCKDB_API string_t AddBlob(const string_t &data)
Add a blob to the string heap; blobs can be non-valid UTF8.
◆ EmptyString()
10140 {
10142 }
DUCKDB_API string_t EmptyString(idx_t len)
Allocates space for an empty string of size "len" on the heap.
◆ 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 }
◆ AddHeapReference()
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 file: