1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-11-23 03:32:32 +00:00

Attempted to reduce allocations.

This commit is contained in:
Thomas Harte 2016-11-16 13:25:50 +08:00
parent c1a509910d
commit 04b2688683

View File

@ -96,7 +96,8 @@ class OpenGLOutputBuilder {
inline uint8_t *get_next_source_run()
{
_line_buffer.data.resize(_line_buffer.pointer + SourceVertexSize);
if(_line_buffer.data.size() < _line_buffer.pointer + SourceVertexSize)
_line_buffer.data.resize(_line_buffer.pointer + SourceVertexSize);
return &_line_buffer.data[_line_buffer.pointer];
}
@ -125,7 +126,6 @@ class OpenGLOutputBuilder {
_output_buffer.pointer += OutputVertexSize;
memcpy(&_source_buffer.data[_source_buffer.pointer], _line_buffer.data.data(), _line_buffer.data.size());
_source_buffer.pointer += _line_buffer.data.size();
_line_buffer.data.resize(0);
_line_buffer.pointer = 0;
}
}