Maj terminée. Pour consulter la release notes associée voici le lien :
https://about.gitlab.com/releases/2021/07/07/critical-security-release-gitlab-14-0-4-released/

Commit 796aa534 authored by BRAMAS Berenger's avatar BRAMAS Berenger
Browse files

Add a method to the group of cell class in order to attach to a buffer after...

Add a method to the group of cell class in order to attach to a buffer after the construction and reset
parent 972319a8
......@@ -44,6 +44,30 @@ protected:
bool deleteBuffer;
public:
FGroupOfCells()
: allocatedMemoryInByte(0), memoryBuffer(nullptr),
blockHeader(nullptr), blockIndexesTable(nullptr), blockCells(nullptr),
deleteBuffer(false){
}
void reset(unsigned char* inBuffer, const size_t inAllocatedMemoryInByte){
if(deleteBuffer){
for(int idxCellPtr = 0 ; idxCellPtr < blockHeader->blockIndexesTableSize ; ++idxCellPtr){
if(blockIndexesTable[idxCellPtr] != CellIsEmptyFlag){
(&blockCells[blockIndexesTable[idxCellPtr]])->~CellClass();
}
}
FAlignedMemory::Dealloc32BAligned(memoryBuffer);
}
// Move the pointers to the correct position
allocatedMemoryInByte = (inAllocatedMemoryInByte);
memoryBuffer = (inBuffer);
blockHeader = reinterpret_cast<BlockHeader*>(memoryBuffer);
blockIndexesTable = reinterpret_cast<int*>(memoryBuffer+sizeof(BlockHeader));
blockCells = reinterpret_cast<CellClass*>(memoryBuffer+sizeof(BlockHeader)+(blockHeader->blockIndexesTableSize*sizeof(int)));
deleteBuffer = (false);
}
/**
* Init from a given buffer
* @param inBuffer
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment