]> git.tdb.fi Git - libs/gl.git/commit
Remove dynamic allocation from VertexFormat
authorMikko Rasa <tdb@tdb.fi>
Sat, 3 Dec 2016 15:53:19 +0000 (17:53 +0200)
committerMikko Rasa <tdb@tdb.fi>
Sat, 3 Dec 2016 15:53:19 +0000 (17:53 +0200)
commit3b159edbe4e80a2bc19c4c2fcd42cb996b9fbfe0
treeb4d2606f988cb7a271410b76a58c07b04b6fa6ec
parent79c49c6b6155857ed0ebe85eb07a996788a6190b
Remove dynamic allocation from VertexFormat

On 64-bit systems the pointer takes eight bytes, and a typical malloc
implementation will have two pointers worth of overhead.  Vertex formats
hardly ever reach even eight components, so it's cheaper to just store
a fixed-size array in the class itself.
source/vertexformat.cpp
source/vertexformat.h