pw_multibuf: Store per-chunk memory context

This CL changes the memory context from being stored one per multibuf to
on each chunk. This allows greater flexibility for adding and removing
chunks. For example, multiple unique and shared pointers from different
allocators can now be added. Notably, owned regions can now be split by
having them be converted to shared regions.

Change-Id: I06b2ef4c731a3849a699bd9cca76b33c9d3fe425
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/332093
Docs-Not-Needed: Aaron Green <aarongreen@google.com>
Commit-Queue: Aaron Green <aarongreen@google.com>
Reviewed-by: Wyatt Hepler <hepler@google.com>
Lint: Lint 🤖 <android-build-ayeaye@system.gserviceaccount.com>
Copybara-Verified: Copybara Prod <copybara-worker-blackhole@google.com>
Pigweed-Auto-Submit: Aaron Green <aarongreen@google.com>
11 files changed
tree: bec3ffbb8ede4ffb8bc6b270813b8c628a12736b
  1. .allstar/
  2. .gemini/
  3. .github/
  4. .vscode/
  5. build_overrides/
  6. docker/
  7. docs/
  8. kudzu/
  9. pw_alignment/
  10. pw_allocator/
  11. pw_analog/
  12. pw_android_toolchain/
  13. pw_arduino_build/
  14. pw_assert/
  15. pw_assert_basic/
  16. pw_assert_fuchsia/
  17. pw_assert_log/
  18. pw_assert_tokenized/
  19. pw_assert_trap/
  20. pw_assert_zephyr/
  21. pw_async/
  22. pw_async2/
  23. pw_async_basic/
  24. pw_async_fuchsia/
  25. pw_atomic/
  26. pw_base64/
  27. pw_bloat/
  28. pw_blob_store/
  29. pw_bluetooth/
  30. pw_bluetooth_hci/
  31. pw_bluetooth_profiles/
  32. pw_bluetooth_proxy/
  33. pw_bluetooth_sapphire/
  34. pw_boot/
  35. pw_boot_cortex_m/
  36. pw_build/
  37. pw_build_android/
  38. pw_build_info/
  39. pw_build_mcuxpresso/
  40. pw_bytes/
  41. pw_change/
  42. pw_channel/
  43. pw_checksum/
  44. pw_chre/
  45. pw_chrono/
  46. pw_chrono_embos/
  47. pw_chrono_freertos/
  48. pw_chrono_rp2040/
  49. pw_chrono_stl/
  50. pw_chrono_threadx/
  51. pw_chrono_zephyr/
  52. pw_cli/
  53. pw_cli_analytics/
  54. pw_clock_tree/
  55. pw_clock_tree_mcuxpresso/
  56. pw_compilation_testing/
  57. pw_config_loader/
  58. pw_console/
  59. pw_containers/
  60. pw_cpu_exception/
  61. pw_cpu_exception_cortex_m/
  62. pw_cpu_exception_risc_v/
  63. pw_crypto/
  64. pw_digital_io/
  65. pw_digital_io_linux/
  66. pw_digital_io_mcuxpresso/
  67. pw_digital_io_rp2040/
  68. pw_digital_io_zephyr/
  69. pw_display/
  70. pw_dma_mcuxpresso/
  71. pw_docgen/
  72. pw_doctor/
  73. pw_elf/
  74. pw_emu/
  75. pw_env_setup/
  76. pw_env_setup_zephyr/
  77. pw_file/
  78. pw_flatbuffers/
  79. pw_format/
  80. pw_function/
  81. pw_fuzzer/
  82. pw_grpc/
  83. pw_hdlc/
  84. pw_hex_dump/
  85. pw_i2c/
  86. pw_i2c_linux/
  87. pw_i2c_mcuxpresso/
  88. pw_i2c_rp2040/
  89. pw_i2c_zephyr/
  90. pw_ide/
  91. pw_interrupt/
  92. pw_interrupt_cortex_m/
  93. pw_interrupt_freertos/
  94. pw_interrupt_zephyr/
  95. pw_intrusive_ptr/
  96. pw_json/
  97. pw_kernel/
  98. pw_kvs/
  99. pw_libc/
  100. pw_libcxx/
  101. pw_log/
  102. pw_log_android/
  103. pw_log_basic/
  104. pw_log_fuchsia/
  105. pw_log_null/
  106. pw_log_rpc/
  107. pw_log_string/
  108. pw_log_tokenized/
  109. pw_log_zephyr/
  110. pw_malloc/
  111. pw_malloc_freelist/
  112. pw_malloc_freertos/
  113. pw_memory/
  114. pw_metric/
  115. pw_module/
  116. pw_multibuf/
  117. pw_multisink/
  118. pw_numeric/
  119. pw_package/
  120. pw_perf_test/
  121. pw_persistent_ram/
  122. pw_polyfill/
  123. pw_preprocessor/
  124. pw_presubmit/
  125. pw_protobuf/
  126. pw_protobuf_compiler/
  127. pw_random/
  128. pw_random_fuchsia/
  129. pw_result/
  130. pw_ring_buffer/
  131. pw_router/
  132. pw_rpc/
  133. pw_rpc_transport/
  134. pw_rust/
  135. pw_sensor/
  136. pw_snapshot/
  137. pw_software_update/
  138. pw_span/
  139. pw_spi/
  140. pw_spi_linux/
  141. pw_spi_mcuxpresso/
  142. pw_spi_rp2040/
  143. pw_status/
  144. pw_stm32cube_build/
  145. pw_stream/
  146. pw_stream_shmem_mcuxpresso/
  147. pw_stream_uart_linux/
  148. pw_stream_uart_mcuxpresso/
  149. pw_string/
  150. pw_symbolizer/
  151. pw_sync/
  152. pw_sync_baremetal/
  153. pw_sync_embos/
  154. pw_sync_freertos/
  155. pw_sync_stl/
  156. pw_sync_threadx/
  157. pw_sync_zephyr/
  158. pw_sys_io/
  159. pw_sys_io_ambiq_sdk/
  160. pw_sys_io_arduino/
  161. pw_sys_io_baremetal_lm3s6965evb/
  162. pw_sys_io_baremetal_stm32f429/
  163. pw_sys_io_emcraft_sf2/
  164. pw_sys_io_mcuxpresso/
  165. pw_sys_io_rp2040/
  166. pw_sys_io_stdio/
  167. pw_sys_io_stm32cube/
  168. pw_sys_io_zephyr/
  169. pw_system/
  170. pw_target_runner/
  171. pw_thread/
  172. pw_thread_embos/
  173. pw_thread_freertos/
  174. pw_thread_stl/
  175. pw_thread_threadx/
  176. pw_thread_zephyr/
  177. pw_tls_client/
  178. pw_tls_client_boringssl/
  179. pw_tls_client_mbedtls/
  180. pw_tokenizer/
  181. pw_toolchain/
  182. pw_trace/
  183. pw_trace_tokenized/
  184. pw_transfer/
  185. pw_uart/
  186. pw_uart_mcuxpresso/
  187. pw_unit_test/
  188. pw_uuid/
  189. pw_varint/
  190. pw_watch/
  191. pw_web/
  192. pw_work_queue/
  193. seed/
  194. targets/
  195. third_party/
  196. zephyr/
  197. .bazelignore
  198. .bazelrc
  199. .bazelversion
  200. .black.toml
  201. .clang-format
  202. .clang-tidy
  203. .git-blame-ignore-revs
  204. .gitattributes
  205. .gitignore
  206. .gn
  207. .mypy.ini
  208. .prettierignore
  209. .prettierrc.cjs
  210. .pw_ide.yaml
  211. .pylintrc
  212. .ruff.toml
  213. activate.bat
  214. Android.bp
  215. AUTHORS
  216. bootstrap.bat
  217. bootstrap.fish
  218. bootstrap.sh
  219. BUILD.bazel
  220. BUILD.gn
  221. BUILDCONFIG.gn
  222. CMakeLists.txt
  223. GEMINI.md
  224. go.mod
  225. go.sum
  226. Kconfig.zephyr
  227. LICENSE
  228. MODULE.bazel
  229. MODULE.bazel.lock
  230. modules.gni
  231. OWNERS
  232. package.json
  233. pigweed.json
  234. PIGWEED_MODULES
  235. pw
  236. README.md
  237. REPO.bazel
  238. rustfmt.toml
  239. tsconfig.json
  240. workflows.json
  241. WORKSPACE
  242. WORKSPACE_OWNERS
README.md

Pigweed

Pigweed is an open source collection of embedded-targeted libraries–or as we like to call them, modules. These modules are building blocks and infrastructure that enable faster and more reliable development on small-footprint MMU-less 32-bit microcontrollers like the STMicroelectronics STM32L452 or the Nordic nRF52832.

For more information please see our website: https://pigweed.dev/.

Links