Memory Allocation
Detailed Description
The AVR Software Framework features a large variety of memory allocators useful for different purposes. Depending on the configuration, the following types of allocators may be available:
- Memory Pool allocator. This allocator organizes a fixed region of memory into fixed-size pools. Allocate and Free are both constant-time operations, but the size of the allocation must be known in advance.
- DMA Pool allocator. This is a memory pool allocator which returns memory suitable for DMA.
- Generic heap allocator (malloc). This allocator may be used to allocate an arbitrary amount of memory, but the run time may be unpredictable, and the implementation is typically large and complicated compared to other allocators.
- Memory Bag allocator. Implemented on top of the memory pool allocator, this allocator provides generic malloc-like functionality while avoiding many of its disadvantages. However, it requires a lot more application-specific configuration than a typical malloc() implementation.