Code size analysis#
pw_allocator: Flexible, safe, and measurable memory allocation
This module provides the Allocator interface, as well as several implementations of it. The tables below shows the relative code size for the interface and each of these implementations. The measurement includes a call to each method.
Allocator interface#
The following shows the code size incurred by the Allocator interface itself. A call to each method of the interface is measured using an empty implementation, NullAllocator.
Note
The size report that is usually displayed here is temporarily unavailable while we migrate the pigweed.dev build system from GN to Bazel. See b/388905812 for updates.
Block implementations#
Most of the concrete allocator implementations are block allocators that use Blocks of memory to manage allocations. Code size and memory overhead for blocks varies depending on what features are included.
The following are code sizes for the block implementations provided by this module.
Note
The size report that is usually displayed here is temporarily unavailable while we migrate the pigweed.dev build system from GN to Bazel. See b/388905812 for updates.
Impact of different hardening levels#
This module includes PW_ALLOCATOR_HARDENING which sets which validation checks are included. Additional checks can detect more errors at the cost of additional code size, as illustrated in the size report below:
Note
The size report that is usually displayed here is temporarily unavailable while we migrate the pigweed.dev build system from GN to Bazel. See b/388905812 for updates.
Bucket implementations#
Most of the concrete allocator implementations are block allocators that use Buckets of blocks to organize blocks that are not in use and are available for allocation.
The following are code sizes for the block implementations provided by this module. These are measured relative to the container they use, as reusing container types may save code size. See pw_containers for code size information on each container type.
Note
The size report that is usually displayed here is temporarily unavailable while we migrate the pigweed.dev build system from GN to Bazel. See b/388905812 for updates.
Block allocator implementations#
Most of the concrete allocator implementations provided by this module that are derived from BlockAllocator. The following are code sizes for each of the block allocator implementations, and are measured relative to the blocks they use.
Note
The size report that is usually displayed here is temporarily unavailable while we migrate the pigweed.dev build system from GN to Bazel. See b/388905812 for updates.
Other concrete allocator implementations#
The following are code sizes for the other allocator implementations that directly manage the memory they use to fulfill requests, but that do not derive from BlockAllocator. These are measured relative to the empty implementation measured above.
Note
The size report that is usually displayed here is temporarily unavailable while we migrate the pigweed.dev build system from GN to Bazel. See b/388905812 for updates.
Forwarding allocators implementations#
The following are code sizes for each of the provided “forwarding” allocators as described by Forwarding allocator concept. These are measured by having the forwarding allocator wrap a FirstFitAllocator, and are measured relative to that implementation.
Note
The size report that is usually displayed here is temporarily unavailable while we migrate the pigweed.dev build system from GN to Bazel. See b/388905812 for updates.