News for hackers. Stuff that matters.
Re:Sentinels Can Be Faster by colejohnson66 on Wednesday September 09, 2020 @04:04PM (#24425312)
For most people, the time difference between reading 4/8 bytes and scanning for a null terminator is negligible, but there’s the other benefit of not having to worry as much about buffer overruns; If you append to a std::string and its internal buffer is full, it’ll realloc() its buffer. This does have the problem of the possibility of a realloc(), but I prefer that over buffer overruns.

There are no comments on this comment yet.