You can make this better by not storing the size at all, even for the long strings: <a href="https:&#x2F;&#x2F;rwmj.wordpress.com&#x2F;2016&#x2F;01&#x2F;08&#x2F;half-baked-ideas-c-strings-with-implicit-length-field&#x2F;" rel="nofollow">https:&#x2F;&#x2F;rwmj.wordpress.com&#x2F;2016&#x2F;01&#x2F;08&#x2F;half-baked-ideas-c-str...</a>