4 ms·
A waste of 8 bytes?
by noobermin 4y ago
A waste of 8 bytes?
- snickerbockers 4y agoWell technically that's implementation-defined, but yes.
- Thiez 4y ago7, since keeping track of the length allows you to skip storing the trailing 0.
- drran 4y agoIf we define `String` type as `{size_t len, size_t offset, char *data}`, then we can store up to 23 bytes directly in the struct, if we will sacrifice 1 bit of `len` field to indicate that.