roll: pigweed pw_bytes: Add PackedPtr

Every object types has an alignment requirement, and for most types this
is greater than one. As a result, pointers to these types have one or
more least significant bits that are always zero. For certain types,
such as intrusive container types, it is desirable to reuse these bits
and avoid creating additional fields.

This class facilitates those use cases by providing a wrapper type that
can be treated like a pointer in many cases, but that can also be used
to set and get a value from the unused bits.

This storage is not free: this class must perform bit operations on
every dereference, adding to its performance cost and code size. This
class should only be used when the benefits of saving memory overhead
outweigh these costs.

Original-Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/235104
Original-Revision: cda5ba673366d189e0ea326a0fa808df181730a7

Rolled-Repo: https://pigweed.googlesource.com/pigweed/pigweed
Rolled-Commits: faac61757b5428..cda5ba673366d1
Roller-URL: https://ci.chromium.org/b/8736437447468905537
GitWatcher: ignore
CQ-Do-Not-Cancel-Tryjobs: true
Change-Id: I6804cb041390b562226a5bd0f9645d196720abf9
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/showcase/sense/+/236834
Bot-Commit: Pigweed Roller <pigweed-roller@pigweed-service-accounts.iam.gserviceaccount.com>
Commit-Queue: Pigweed Roller <pigweed-roller@pigweed-service-accounts.iam.gserviceaccount.com>
Lint: Lint 🤖 <android-build-ayeaye@system.gserviceaccount.com>
1 file changed
tree: eddaf1c3c51b756f49496cf84b2c86b3cb095b04
  1. .github/
  2. .vscode/
  3. apps/
  4. device/
  5. modules/
  6. system/
  7. targets/
  8. tools/
  9. web_app/
  10. .bazelignore
  11. .bazelrc
  12. .bazelversion
  13. .buildifier.json
  14. .clang-format
  15. .clangd.shared
  16. .gitignore
  17. .pw_console.yaml
  18. AUTHORS
  19. BUILD.bazel
  20. CONTRIBUTING.md
  21. LICENSE
  22. MODULE.bazel
  23. MODULE.bazel.lock
  24. OWNERS
  25. pigweed.json
  26. README.md
README.md

Sense

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.