commit | abd2456cf05a44c8d319d4ae912afd69db552010 | [log] [tgz] |
---|---|---|
author | Wyatt Hepler <hepler@pigweed.infra.roller.google.com> | Tue Aug 20 19:00:55 2024 +0000 |
committer | CQ Bot Account <pigweed-scoped@luci-project-accounts.iam.gserviceaccount.com> | Tue Aug 20 19:00:55 2024 +0000 |
tree | c19d92b52b2929329aa28791f71368f3a102bb8b | |
parent | afc5342507a2c943f125c43b2fc2a4c72a636f77 [diff] |
roll: pigweed, pw_toolchain: pw_multibuf: Restructure ChunkIterable MultiBuf is a byte-oriented view of a list of chunks, and this change structures MultiBuf accordingly. This replaces the ChunkIterable class with a private MultiBufChunks base class that provides the Chunk-oriented view for MultiBuf. Restructuring this way fixes an issue where MultiBuf data can be modified from a const reference. MultiBuf originally returned a const ChunkIterable, but since return values are copied, this becomes a non-const ChunkIterable, giving mutable access to the multibuf. const MultiBuf& const_mb = mb; auto chunk_iterable = cmb.Chunks(); // chunk_iterable is non-const iterable.front()[0] = std::byte(); // uh oh, chunk data is mutable! Original-Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/230892 https://pigweed.googlesource.com/pigweed/pigweed pigweed, pw_toolchain Rolled-Commits: 03da4a376d12ab8..7e7c141c8808200 Roller-URL: https://ci.chromium.org/b/8739059875420670833 GitWatcher: ignore CQ-Do-Not-Cancel-Tryjobs: true Change-Id: Id5bbf5c18e2a0d1be7d75a642526beadcdfd6915 Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/showcase/sense/+/230874 Bot-Commit: Pigweed Roller <pigweed-roller@pigweed-service-accounts.iam.gserviceaccount.com> Lint: Lint 🤖 <android-build-ayeaye@system.gserviceaccount.com> Commit-Queue: Pigweed Roller <pigweed-roller@pigweed-service-accounts.iam.gserviceaccount.com>
git clone https://pigweed.googlesource.com/pigweed/showcase/sense
Welcome to Pigweed Sense, a tour of key Pigweed components experienced through an imagined air quality product.
Please visit Sense: An interactive tour through Pigweed to get started.