Code is based on Valve's implementation, with the following changes: - Usage of 64bit signed size types. - Usage of const where possible. - Removal of field 'CCommandBuffer::m_nLastUsedArgSSize'.