MCPcopy Create free account
hub / github.com/LadybugDB/ladybug / allocateUnflatTupleBlock

Method allocateUnflatTupleBlock

src/processor/result/factorized_table.cpp:393–409  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

391}
392
393uint8_t* FactorizedTable::allocateUnflatTupleBlock(uint32_t numBytes) {
394 if (unFlatTupleBlockCollection->isEmpty()) {
395 auto newBlock = std::make_unique<DataBlock>(memoryManager, getDataBlockSize(numBytes));
396 unFlatTupleBlockCollection->append(std::move(newBlock));
397 }
398 auto lastBlock = unFlatTupleBlockCollection->getLastBlock();
399 if (lastBlock->freeSize > numBytes) {
400 auto writableData = lastBlock->getWritableData();
401 lastBlock->freeSize -= numBytes;
402 return writableData;
403 }
404 auto newBlock = std::make_unique<DataBlock>(memoryManager, getDataBlockSize(numBytes));
405 unFlatTupleBlockCollection->append(std::move(newBlock));
406 lastBlock = unFlatTupleBlockCollection->getLastBlock();
407 lastBlock->freeSize -= numBytes;
408 return lastBlock->getData();
409}
410
411void FactorizedTable::copyFlatVectorToFlatColumn(const ValueVector& vector,
412 const BlockAppendingInfo& blockAppendInfo, ft_col_idx_t colIdx) {

Callers

nothing calls this directly

Calls 6

getDataBlockSizeFunction · 0.85
getLastBlockMethod · 0.80
getWritableDataMethod · 0.80
isEmptyMethod · 0.45
appendMethod · 0.45
getDataMethod · 0.45

Tested by

no test coverage detected