Cesium icon indicating copy to clipboard operation
Cesium copied to clipboard

String literal storage optimization

Open ForNeVeR opened this issue 3 years ago • 1 comments
trafficstars

When storing two literals, "bar" and "foobar", the compiler may optimize them to save space in the binary: only store "foobar" and point "bar" pointer to the middle of the literal.

 f o o b a r \0
 ↑     ↑
 |    "bar" points here
"foobar" points here

ForNeVeR avatar Jan 11 '22 17:01 ForNeVeR

Thanks to @a1batross for this suggestion.

ForNeVeR avatar Jan 11 '22 17:01 ForNeVeR