PutAttributeLengthInData
Created by: germasch
from BP3Serializer.tcc
:
template <class T>
void BP3Serializer::PutAttributeLengthInData(
const core::Attribute<T> &attribute, Stats<T> &stats,
const size_t attributeLengthPosition) noexcept
{
auto &buffer = m_Data.m_Buffer;
auto &position = m_Data.m_Position;
auto &absolutePosition = m_Data.m_AbsolutePosition;
// back to attribute length
size_t backPosition = attributeLengthPosition;
helper::CopyToBuffer(buffer, backPosition, &attributeLengthPosition);
absolutePosition += position - attributeLengthPosition;
}
The code that serializes attributes leaves a gap for the length (as I understand the comment). This then later gets filled in by the code above. However, what that the code above is to write the position of attribute length in the file into that spot. That seems questionable to me. As does the fact that it looks to me that a 4 byte gap had been reserved before, but now size_t, ie 8 bytes on 64-bit systems are written.
I haven't seen any trouble related to it, though.