In `StringWriter`, fix poisoning of memory supposed to be unused. After seeking
back, it is possible that `written_size_` exceeds the cursor, in which case
memory between the cursor and `written_size_` is valid and must not be poisoned.

In `{String,Resizable}Writer::Push()`, protect against the theoretical
possibility of `recommended_length` being so large that it overflows `size_t`
when added to `size()`.

Optimize a call to `std::string::reserve()`: since C++20 it can no longer be
interpreted as a non-binding shrink request.

Clean up comments at `ResizableWriter`.

PiperOrigin-RevId: 868698749
3 files changed
tree: 64fdc7274cec38bc647008071ee623779f741f3b
  1. doc/
  2. python/
  3. riegeli/
  4. tf_dependency/
  5. .bazelrc
  6. configure
  7. CONTRIBUTING.md
  8. LICENSE
  9. MANIFEST.in
  10. MODULE.bazel
  11. README.md
README.md

Riegeli

Riegeli/records is a file format for storing a sequence of string records, typically serialized protocol buffers. It supports dense compression, fast decoding, seeking, detection and optional skipping of data corruption, filtering of proto message fields for even faster decoding, and parallel encoding.

See documentation.

Status

Riegeli file format will only change in a backward compatible way (i.e. future readers will understand current files, but current readers might not understand files using future features).

Riegeli C++ API might change in incompatible ways.