pw_allocator: Add MeasureFragmentation

This CL provides an implementation of the algorithm to calculate a
fragmentation metric that was only previously described. This typically
shouldn't be invoked on device unless there is robust floating point
support. Adding this method allows platforms that do have floating
support to avoid implementing it themselves, as well as providing it for
host tasks like benchmarking.

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