Re:The Most Expensive One-byte Mistake (2011)
by millstone on Friday April 11, 2014 @02:56PM
(#7574737)
You piqued my interest, and it looks like NUL-terminated strings in files is actually common. tar, ELF, JPEG, gzip all use them. When the serialization format matches the in-memory format, you can mmap directly into a struct, which is fast and convenient.
Re:The Most Expensive One-byte Mistake (2011)
by 1amzave on Friday April 11, 2014 @06:27PM
(#7575967)
> When the serialization format matches the in-memory format, you can mmap directly into a struct, which is fast and convenient.
...and a non-starter if you ever have data interchange between differing types of machines.
I agree that NUL-terminated strings were the right decision at the time (and aren't that bad now), but there are sane ways to do counted strings.